diff --git a/.idea/commands.md b/.idea/commands.md index 3f13416..e43ff31 100644 --- a/.idea/commands.md +++ b/.idea/commands.md @@ -1,7 +1,7 @@ -# Commands Idea - -Here is an idea what commands do we have to implement in this package. - -- `mdsanima` main command -- `mdsanima pixelart` generate pixelart -- `mdsanima gifmaker` generate gif animation +# Commands Idea + +Here is an idea what commands do we have to implement in this package. + +- `mdsanima` main command +- `mdsanima pixelart` generate pixelart +- `mdsanima gifmaker` generate gif animation diff --git a/README.md b/README.md index 4dec9fb..f481891 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Now you can use this command in terminal: mdsanima ``` -The response is simple `Hello World` for now. +The response is printing help. ## Development Setup diff --git a/pyproject.toml b/pyproject.toml index 601b082..19e3668 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,99 +1,99 @@ -# Copyritht © 2023 Marcin Różewski MDSANIMA - -[build-system] -requires = ['setuptools>=67.1.0', 'wheel>=0.38.4', 'pip>=23.0', 'setuptools_scm[toml]>=7.1'] -build-backend = 'setuptools.build_meta' - -[project] -name = 'mdsanima_cli' -authors = [{name = 'Marcin Różewski', email = 'marcinrozewski@gmail.com'}] -description = 'Command line tools for images processing, generating pixelart, adding logo to images and many more.' -readme = 'README.md' -license = {file = 'LICENSE'} -requires-python = '>=3.10' -keywords = [ - 'cli', - 'command line', - 'console-app', - 'console-application', - 'exif metadata', - 'image-processing', - 'images', - 'mdsanima command line', - 'mdsanima-cli', - 'mdsanima-dev', - 'mdsanima', - 'meta information', - 'pixelart', - 'python-library', - 'python', - 'python3', - 'shell-script', -] -classifiers = [ - 'Development Status :: 1 - Planning', - 'Environment :: Console', - 'Environment :: Plugins', - 'Intended Audience :: Developers', - 'Intended Audience :: Education', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Information Technology', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Other Audience', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Apache Software License', - 'Natural Language :: English', - 'Natural Language :: Polish', - 'Operating System :: MacOS', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX :: BSD', - 'Operating System :: POSIX :: Linux', - 'Operating System :: Unix', - 'Programming Language :: Python :: 3.10', - 'Topic :: Desktop Environment', - 'Topic :: Documentation :: Sphinx', - 'Topic :: Education :: Testing', - 'Topic :: Multimedia', - 'Topic :: Scientific/Engineering :: Image Processing', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: System :: Console Fonts', - 'Topic :: System :: Shells', - 'Topic :: System :: System Shells', - 'Topic :: Terminals', - 'Topic :: Text Processing', - 'Topic :: Utilities', -] -dependencies = [ - # 'Pillow==9.4.0', - 'mdsanima-dev==0.1.1', -] -dynamic = ['version'] - -[project.urls] -homepage = '/~https://github.com/mdsanima-lab/mdsanima-cli' -documentation = '/~https://github.com/mdsanima-lab/mdsanima-cli#readme' -repository = '/~https://github.com/mdsanima-lab/mdsanima-cli.git' -changelog = '/~https://github.com/mdsanima-lab/mdsanima-cli/blob/main/CHANGELOG.md' - -[project.scripts] -mdsanima = 'mdsanima_cli:main_cli' - -[tool.black] -line-length = 79 -target-version = ['py310'] -include = '\.pyi?$' - -[tool.isort] -profile = 'black' -src_paths = ['src', 'tests'] -force_single_line = true -lines_before_imports = 2 -lines_after_imports = 2 -treat_all_comments_as_code = true -extend_skip = ['.md', '.json'] - -[tool.setuptools.packages.find] -where = ['src'] - -[tool.setuptools_scm] -write_to = 'src/mdsanima_cli/_version.py' +# Copyritht © 2023 Marcin Różewski MDSANIMA + +[build-system] +requires = ['setuptools>=67.1.0', 'wheel>=0.38.4', 'pip>=23.0', 'setuptools_scm[toml]>=7.1'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'mdsanima_cli' +authors = [{name = 'Marcin Różewski', email = 'marcinrozewski@gmail.com'}] +description = 'Command line tools for images processing, generating pixelart, adding logo to images and many more.' +readme = 'README.md' +license = {file = 'LICENSE'} +requires-python = '>=3.10' +keywords = [ + 'cli', + 'command line', + 'console-app', + 'console-application', + 'exif metadata', + 'image-processing', + 'images', + 'mdsanima command line', + 'mdsanima-cli', + 'mdsanima-dev', + 'mdsanima', + 'meta information', + 'pixelart', + 'python-library', + 'python', + 'python3', + 'shell-script', +] +classifiers = [ + 'Development Status :: 1 - Planning', + 'Environment :: Console', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: End Users/Desktop', + 'Intended Audience :: Information Technology', + 'Intended Audience :: Legal Industry', + 'Intended Audience :: Other Audience', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Natural Language :: Polish', + 'Operating System :: MacOS', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: POSIX :: BSD', + 'Operating System :: POSIX :: Linux', + 'Operating System :: Unix', + 'Programming Language :: Python :: 3.10', + 'Topic :: Desktop Environment', + 'Topic :: Documentation :: Sphinx', + 'Topic :: Education :: Testing', + 'Topic :: Multimedia', + 'Topic :: Scientific/Engineering :: Image Processing', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: System :: Console Fonts', + 'Topic :: System :: Shells', + 'Topic :: System :: System Shells', + 'Topic :: Terminals', + 'Topic :: Text Processing', + 'Topic :: Utilities', +] +dependencies = [ + # 'Pillow==9.4.0', + 'mdsanima-dev==0.1.1', +] +dynamic = ['version'] + +[project.urls] +homepage = '/~https://github.com/mdsanima-lab/mdsanima-cli' +documentation = '/~https://github.com/mdsanima-lab/mdsanima-cli#readme' +repository = '/~https://github.com/mdsanima-lab/mdsanima-cli.git' +changelog = '/~https://github.com/mdsanima-lab/mdsanima-cli/blob/main/CHANGELOG.md' + +[project.scripts] +mdsanima = 'mdsanima_cli:main_cli' + +[tool.black] +line-length = 79 +target-version = ['py310'] +include = '\.pyi?$' + +[tool.isort] +profile = 'black' +src_paths = ['src', 'tests'] +force_single_line = true +lines_before_imports = 2 +lines_after_imports = 2 +treat_all_comments_as_code = true +extend_skip = ['.md', '.json'] + +[tool.setuptools.packages.find] +where = ['src'] + +[tool.setuptools_scm] +write_to = 'src/mdsanima_cli/_version.py' diff --git a/src/mdsanima_cli/__init__.py b/src/mdsanima_cli/__init__.py index 808d96b..3382b6d 100644 --- a/src/mdsanima_cli/__init__.py +++ b/src/mdsanima_cli/__init__.py @@ -1,67 +1,67 @@ -# Copyritht © 2023 Marcin Różewski MDSANIMA - - -"""Initial main functionality for command line tools.""" - - -from __future__ import annotations - -from ._version import __version__ - -import argparse -from mdsanima_dev.colors import get_complex_color - - -AP_DESCRIPTION = "Command line tools for images processing." -AP_EPILOG = "Copyritht \U000000A9 2023 Marcin Różewski MDSANIMA" - - -def create_parser() -> None: - # Create top level argument parser. - parser = argparse.ArgumentParser( - prog="mdsanima", - description=AP_DESCRIPTION, - epilog=AP_EPILOG, - formatter_class=argparse.RawTextHelpFormatter, - ) - parser.add_argument( - "-v", - "--version", - action="version", - version="%(prog)s-cli " + __version__, - ) - subparsers = parser.add_subparsers() - - # Create subparser for pixelart. - pixelart_parser = subparsers.add_parser( - "pixelart", - description="Generating pixelart from images.", - help="computing all images in folder", - epilog=AP_EPILOG, - ) - pixelart_parser.set_defaults(command="pixelart") - - # Create subparser for gifmaker. - gifmaker_parser = subparsers.add_parser( - "gifmaker", - description="Generating gif from pixelart images.", - help="computing gif from one pixelart image", - epilog=AP_EPILOG, - ) - gifmaker_parser.set_defaults(command="gifmaker") - - return parser - - -def main_cli(): - parser = create_parser() - args = parser.parse_args() - mprint = get_complex_color - - try: - if args.command == "pixelart": - mprint("Hello from pixelart", 46) - elif args.command == "gifmaker": - mprint("Hello from gifmaker", 46) - except AttributeError: - parser.print_help() +# Copyritht © 2023 Marcin Różewski MDSANIMA + + +"""Initial main functionality for command line tools.""" + + +from __future__ import annotations + +from ._version import __version__ + +import argparse +from mdsanima_dev.colors import get_complex_color + + +AP_DESCRIPTION = "Command line tools for images processing." +AP_EPILOG = "Copyritht \U000000A9 2023 Marcin Różewski MDSANIMA" + + +def create_parser() -> None: + # Create top level argument parser. + parser = argparse.ArgumentParser( + prog="mdsanima", + description=AP_DESCRIPTION, + epilog=AP_EPILOG, + formatter_class=argparse.RawTextHelpFormatter, + ) + parser.add_argument( + "-v", + "--version", + action="version", + version="%(prog)s-cli " + __version__, + ) + subparsers = parser.add_subparsers() + + # Create subparser for pixelart. + pixelart_parser = subparsers.add_parser( + "pixelart", + description="Generating pixelart from images.", + help="computing all images in folder", + epilog=AP_EPILOG, + ) + pixelart_parser.set_defaults(command="pixelart") + + # Create subparser for gifmaker. + gifmaker_parser = subparsers.add_parser( + "gifmaker", + description="Generating gif from pixelart images.", + help="computing gif from one pixelart image", + epilog=AP_EPILOG, + ) + gifmaker_parser.set_defaults(command="gifmaker") + + return parser + + +def main_cli(): + parser = create_parser() + args = parser.parse_args() + mprint = get_complex_color + + try: + if args.command == "pixelart": + mprint("Hello from pixelart", 46) + elif args.command == "gifmaker": + mprint("Hello from gifmaker", 46) + except AttributeError: + parser.print_help() diff --git a/src/mdsanima_cli/__main__.py b/src/mdsanima_cli/__main__.py index fc12ae4..1cb31c0 100644 --- a/src/mdsanima_cli/__main__.py +++ b/src/mdsanima_cli/__main__.py @@ -1,13 +1,13 @@ -# Copyritht © 2023 Marcin Różewski MDSANIMA - - -"""Main entry point for command line tools.""" - - -from __future__ import annotations - -from . import main_cli - - -if __name__ == "__main__": - raise SystemExit(main_cli()) +# Copyritht © 2023 Marcin Różewski MDSANIMA + + +"""Main entry point for command line tools.""" + + +from __future__ import annotations + +from . import main_cli + + +if __name__ == "__main__": + raise SystemExit(main_cli())