Skip to content

Commit

Permalink
Add setup files
Browse files Browse the repository at this point in the history
  • Loading branch information
pshreyam committed Oct 19, 2022
1 parent abb47e0 commit f33ef19
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 3 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Sketch Image

Convert Images to Sketches

# Installation

```bash
pip install sketch-image
```

# Get Started

```bash
sketch-image --image <image_path> --output <output_path>
```

Note: The `--image` and `--output` flags are optional.

- The CLI will prompt for input image path until supplied.
- The output will be placed in the Pictures directory within the user's home directory by default.

For help, run:

```bash
sketch-image --help
```
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
27 changes: 27 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[metadata]
name = sketch-image
version = 0.0.1
author = Shreyam Pokharel
author_email = [email protected]
description = Convert images into sketches
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/pshreyam/image-sketcher
project_urls =
Bug Tracker = https://github.com/pshreyam/image-sketcher/issues
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent

[options]
packages = find:
python_requires = >=3.6
install_requires=
click==8.1.3
numpy==1.23.4
opencv-python==4.6.0.66

[options.entry_points]
console_scripts =
sketch-image = sketch_image.__main__:convert
Empty file added sketch_image/__init__.py
Empty file.
7 changes: 4 additions & 3 deletions src/main.py → sketch_image/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@click.command()
@click.option("--image", prompt="Image", help="Name of the image to sketch.")
@click.option("--output", default=DEFAULT_OUTPUT_PATH, help="Name of the output file.")
def main(image, output):
def convert(image, output):
try:
img = cv.imread(image)
gray_image = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
Expand All @@ -38,5 +38,6 @@ def main(image, output):
click.secho(f"File written to {output}", fg="green")

click.secho("THANK YOU!", fg="green")

main()

if __name__ == "__main__":
convert()

0 comments on commit f33ef19

Please sign in to comment.