Metadata-Version: 2.1
Name: mdsanima-cli
Version: 0.3.0
Summary: Command-line tools for image processing, generating pixel art, adding logos to images, and much more.
Author-email: Marcin Różewski <marcinrozewski@gmail.com>
License: Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source" form shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object" form shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media types.
        
              "Work" shall mean the work of authorship, whether in Source or
              Object form, made available under the License, as indicated by a
              copyright notice that is included in or attached to the work
              (an example is provided in the Appendix below).
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work and for which the
              editorial revisions, annotations, elaborations, or other modifications
              represent, as a whole, an original work of authorship. For the purposes
              of this License, Derivative Works shall not include works that remain
              separable from, or merely link (or bind by name) to the interfaces of,
              the Work and Derivative Works thereof.
        
              "Contribution" shall mean any work of authorship, including
              the original version of the Work and any modifications or additions
              to that Work or Derivative Works thereof, that is intentionally
              submitted to Licensor for inclusion in the Work by the copyright owner
              or by an individual or Legal Entity authorized to submit on behalf of
              the copyright owner. For the purposes of this definition, "submitted"
              means any form of electronic, verbal, or written communication sent
              to the Licensor or its representatives, including but not limited to
              communication on electronic mailing lists, source code control systems,
              and issue tracking systems that are managed by, or on behalf of, the
              Licensor for the purpose of discussing and improving the Work, but
              excluding communication that is conspicuously marked or otherwise
              designated in writing by the copyright owner as "Not a Contribution."
        
              "Contributor" shall mean Licensor and any individual or Legal Entity
              on behalf of whom a Contribution has been received by Licensor and
              subsequently incorporated within the Work.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              (except as stated in this section) patent license to make, have made,
              use, offer to sell, sell, import, and otherwise transfer the Work,
              where such license applies only to those patent claims licensable
              by such Contributor that are necessarily infringed by their
              Contribution(s) alone or by combination of their Contribution(s)
              with the Work to which such Contribution(s) was submitted. If You
              institute patent litigation against any entity (including a
              cross-claim or counterclaim in a lawsuit) alleging that the Work
              or a Contribution incorporated within the Work constitutes direct
              or contributory patent infringement, then any patent licenses
              granted to You under this License for that Work shall terminate
              as of the date such litigation is filed.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or
                  Derivative Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work,
                  excluding those notices that do not pertain to any part of
                  the Derivative Works; and
        
              (d) If the Work includes a "NOTICE" text file as part of its
                  distribution, then any Derivative Works that You distribute must
                  include a readable copy of the attribution notices contained
                  within such NOTICE file, excluding those notices that do not
                  pertain to any part of the Derivative Works, in at least one
                  of the following places: within a NOTICE text file distributed
                  as part of the Derivative Works; within the Source form or
                  documentation, if provided along with the Derivative Works; or,
                  within a display generated by the Derivative Works, if and
                  wherever such third-party notices normally appear. The contents
                  of the NOTICE file are for informational purposes only and
                  do not modify the License. You may add Your own attribution
                  notices within Derivative Works that You distribute, alongside
                  or as an addendum to the NOTICE text from the Work, provided
                  that such additional attribution notices cannot be construed
                  as modifying the License.
        
              You may add Your own copyright statement to Your modifications and
              may provide additional or different license terms and conditions
              for use, reproduction, or distribution of Your modifications, or
              for any such Derivative Works as a whole, provided Your use,
              reproduction, and distribution of the Work otherwise complies with
              the conditions stated in this License.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution intentionally submitted for inclusion in the Work
              by You to the Licensor shall be under the terms and conditions of
              this License, without any additional terms or conditions.
              Notwithstanding the above, nothing herein shall supersede or modify
              the terms of any separate license agreement you may have executed
              with Licensor regarding such Contributions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor,
              except as required for reasonable and customary use in describing the
              origin of the Work and reproducing the content of the NOTICE file.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work (and each
              Contributor provides its Contributions) on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
              implied, including, without limitation, any warranties or conditions
              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
              PARTICULAR PURPOSE. You are solely responsible for determining the
              appropriateness of using or redistributing the Work and assume any
              risks associated with Your exercise of permissions under this License.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              unless required by applicable law (such as deliberate and grossly
              negligent acts) or agreed to in writing, shall any Contributor be
              liable to You for damages, including any direct, indirect, special,
              incidental, or consequential damages of any character arising as a
              result of this License or out of the use or inability to use the
              Work (including but not limited to damages for loss of goodwill,
              work stoppage, computer failure or malfunction, or any and all
              other commercial damages or losses), even if such Contributor
              has been advised of the possibility of such damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer,
              and charge a fee for, acceptance of support, warranty, indemnity,
              or other liability obligations and/or rights consistent with this
              License. However, in accepting such obligations, You may act only
              on Your own behalf and on Your sole responsibility, not on behalf
              of any other Contributor, and only if You agree to indemnify,
              defend, and hold each Contributor harmless for any liability
              incurred by, or claims asserted against, such Contributor by reason
              of your accepting any such warranty or additional liability.
        
           END OF TERMS AND CONDITIONS
        
           APPENDIX: How to apply the Apache License to your work.
        
              To apply the Apache License to your work, attach the following
              boilerplate notice, with the fields enclosed by brackets "[]"
              replaced with your own identifying information. (Don't include
              the brackets!)  The text should be enclosed in the appropriate
              comment syntax for the file format. We also recommend that a
              file or class name and description of purpose be included on the
              same "printed page" as the copyright notice for easier
              identification within third-party archives.
        
           Copyright (c) 2023 MDSANIMA
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
        
Project-URL: homepage, https://github.com/mdsanima-lab/mdsanima-cli
Project-URL: documentation, https://github.com/mdsanima-lab/mdsanima-cli#readme
Project-URL: repository, https://github.com/mdsanima-lab/mdsanima-cli.git
Project-URL: changelog, https://github.com/mdsanima-lab/mdsanima-cli/blob/main/CHANGELOG.md
Keywords: bash,cli,command-line,console-app,console-application,exif metadata,exif,image-processing,images,logo,mdsanima command line,mdsanima command-line,mdsanima-cli,mdsanima-dev,mdsanima,meta information,pixel art,pixelart,python-library,python,python3,shell-script,shell,watermark,zsh
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Environment :: Plugins
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Legal Industry
Classifier: Intended Audience :: Other Audience
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Natural Language :: Polish
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: BSD
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Desktop Environment
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Education :: Testing
Classifier: Topic :: Multimedia
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Graphics :: Editors
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System
Classifier: Topic :: System :: Console Fonts
Classifier: Topic :: System :: Filesystems
Classifier: Topic :: System :: Logging
Classifier: Topic :: System :: Operating System
Classifier: Topic :: System :: Shells
Classifier: Topic :: System :: System Shells
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: System :: Systems Administration :: Authentication/Directory
Classifier: Topic :: Terminals
Classifier: Topic :: Text Processing
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mdsanima-dev ==0.1.1
Requires-Dist: piexif ==1.1.3
Requires-Dist: pillow ==10.0.1
Provides-Extra: dev
Requires-Dist: black ==23.9.1 ; extra == 'dev'
Requires-Dist: build ==1.0.3 ; extra == 'dev'
Requires-Dist: flake8 ==6.1.0 ; extra == 'dev'
Requires-Dist: isort ==5.12.0 ; extra == 'dev'
Requires-Dist: pylint ==3.0.1 ; extra == 'dev'
Requires-Dist: setuptools-scm ==8.0.4 ; extra == 'dev'
Requires-Dist: twine ==4.0.2 ; extra == 'dev'
Requires-Dist: virtualenv ==20.24.5 ; extra == 'dev'

# mdsanima-cli

[![GitHub Repo License](https://img.shields.io/github/license/mdsanima-lab/mdsanima-cli?logo=apache)][link-github-repo-license]
[![GitHub Repo Stars](https://img.shields.io/github/stars/mdsanima-lab/mdsanima-cli?logo=github)][link-github-repo-stars]
[![PePy Total Downloads](https://img.shields.io/pepy/dt/mdsanima-cli?logo=python&logoColor=lightgray)][link-pepy-total-downloads]
[![PyPi Latest Version](https://img.shields.io/pypi/v/mdsanima-cli?logo=python&logoColor=lightgray)][link-pypi-project]
[![PyPi Python Version](https://img.shields.io/pypi/pyversions/mdsanima-cli?logo=python&logoColor=lightgray)][link-pypi-project]
[![PyPi Format](https://img.shields.io/pypi/format/mdsanima-cli?logo=python&logoColor=lightgray)][link-pypi-project]
[![Code Style Black](https://img.shields.io/badge/code_style-black-black?logo=python&logoColor=lightgray)][link-code-style-black]

[![GitHub Followers MDSANIMA](https://img.shields.io/github/followers/mdsanima?style=social)][link-mdsanima-github-account]
[![X Follow MDSANIMA](https://img.shields.io/twitter/follow/mdsanima?style=social)][link-mdsanima-x-account]
[![Reddit Subreddit Subscribers MDSANIMA](https://img.shields.io/reddit/subreddit-subscribers/mdsanima?style=social)][link-mdsanima-reddit-account]
[![YouTube Subscribers MDSANIMA](https://img.shields.io/youtube/channel/subscribers/UCB5na2BRwrnwx00LCspbG5Q?style=social)][link-mdsanima-youtube-account]
[![Discord Channel Chat MDSANIMA](https://img.shields.io/discord/621477380359454742?style=social&logo=discord)][link-mdsanima-discord-account]
[![Twitch Channel Status MDSANIMA](https://img.shields.io/twitch/status/mdsanima?style=social)][link-mdsanima-twitch-account]

Command-line tools for image processing, generating pixel art, adding logos to images, and much more.

These command-line tools are readily available for a multitude of image processing tasks, such as manipulating images, generating mesmerizing pixel art, seamlessly integrating logos into visuals, and accomplishing a diverse array of other creative endeavors. By harnessing the power of these tools, users can unlock endless possibilities for creating captivating artwork that can greatly enhance a wide range of projects.

## Package Installation

Install or update the latest version using pip:

```shell
python3 -m pip install --upgrade mdsanima-cli
```

The package is now installed, and you can start using it.

## CLI Terminal Commands

After installing the package, you can now use the `mdsanima` command in the terminal, and the response will provide instructions on how to use these command-line tools. You can also use the `mds` alias, which has the same functionality.

Below are the available commands that have been marked as completed, along with some ideas for commands that we would like to implement in this package:

- [x] `mdsanima` main command showing help
- [x] `mdsanima check` print directory info
- [x] `mdsanima uuid` rename to uuid
- [x] `mdsanima number` rename to seq numbers
- [x] `mdsanima logo` append a logo
- [x] `mdsanima watermark` append a watermark
- [x] `mdsanima jpg` convert to jpg
- [x] `mdsanima png` convert to png
- [x] `mdsanima webp` convert to webp
- [x] `mdsanima pixelart` generate pixel art 32px
- [x] `mdsanima grid` generate grid 2x2
- [x] `mdsanima thumbnail` generate jpeg thumbnail 128px
- [x] `mdsanima gifmaker` generate gif animation pixel art
- [x] `mdsanima resize` resizing to 512px width
- [ ] `mdsanima multi` generate multi resolution
- [ ] `mdsanima caption` adding caption
- [ ] `mdsanima bg` adding background
- [ ] `mdsanima filter` adding filter
- [ ] `mdsanima crop` cropping image

The `pixelart` command works in a folder that contains only `.png` images and converts these images into pixel art by creating a new file and appending the suffix `pixelart` to the original file name. After executing this command, all image files in the folder you are in will be processed. The command does not delete any files in the folder, it only adds new ones and displays directory information.

## Development

Here are some helpful instructions in the development process of this Python package.

### Python Setup

This package is built using specific tools and will be published on PyPI using Twine. Instructions on how to activate the **virtual environment** for this project and how to configure and build the package. We will use specific package versions and **Python 3.11** for now.

#### Virtual Environment

Make sure you have `virtualenv` installed on your system. If not, enter this command:

```shell
python3.11 -m pip install virtualenv
```

Creating and activating the development environment, and then installing the necessary packages, enter the following commands in the terminal:

```shell
virtualenv --setuptools=68.2.2 --wheel=0.41.2 --pip=23.2.1 --python=python3.11 .venv
source .venv/bin/activate
pip install -r requirements.txt -r requirements-dev.txt
```

All dependencies for this project are specified in the `requirements.*` files and in the project's TOML configuration.

You can install these dependencies using the `pip install .` command, which will build our package and install the basic dependencies along with the new version of our package. To install dev dependencies, you can use the `pip install ".[dev]"` command instead of specifying a `-r` flag and file as mentioned earlier.

After following the above instructions, we can start writing the program. You can also refer to the instructions regarding the configuration of the development environment, which are included in this [workflow](https://docs.mdsanima.dev/development/workflow/) guide.

#### Build Package

Building our **Python** package is done using the `build` module, which was previously installed as a requirement in the `requirements-dev.txt` file when activating the development environment.

To build the package, enter the following command in the terminal:

```shell
python -m build
```

After building, the package will be placed in a folder named `dist`, and the filename will have the `.whl` extension, including the package name and version.

#### Install Package

After building the package, you can install it by entering the following command in the terminal:

```shell
pip install --force-reinstall dist/mdsanima_cli-0.2.0-py3-none-any.whl
```

The `--force-reinstall` flag is necessary when installing the package because if you have a previous version installed, the installation will fail. Please note that the above command may change depending on the version you are currently building.

#### Testing Package

After building and installing our package, we can test it. You can use the appropriate **CLI** command mentioned above or test individual modules by entering the following command in the terminal:

```shell
python -m mdsanima_cli.commands.pixelart
```

You can also run and test before building and installing the package, type in the terminal:

```shell
python3 src/mdsanima_cli/commands/pixelart.py
```

After running the above command, you will test only the selected module.

#### Extracts Version

The _setuptools-scm_ tool allows you to extract the **Python** package version from _git_ instead of declaring it as a version argument.

If you need to confirm which version string is being generated, you can use the _setuptools-scm_ tool, which will display the current version you are working with. Enter the following command in the terminal:

```shell
python -m setuptools_scm
```

Check the [pyproject.toml](pyproject.toml) file and this [instruction](https://pypi.org/project/setuptools-scm/) for more info.

### Creating Release

Below is the instruction on how to create a release version of our Python package.

Here are the steps to create a release version:

1. Add new code to the package
2. Test new functionality
3. Commit the changes
4. Bump the package version
5. Generate the CHANGELOG.md file
6. Commit the release
7. Add and push the new tag
8. Build and Update on PyPI

This is done manually for now, but we plan to set up a _GitHub Action_ workflow for testing and automatic release version creation in the future.

#### Conventional Commits

In this project, we use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) - a specification for adding human and machine readable meaning to commit messages.

Therefore, a crucial step is to commit your code changes using this specification. A commit message should look like this:

```shell
git commit -m "feat: generating pixel art command"
```

Always use this format for committing to Git, as it enables generating a changelog from the commit message.

#### Standard Version

Check the [package.json](package.json) file in the **standard-version** section and in the types lists for the first string that you can use in the commit message or check the [examples](https://www.conventionalcommits.org/en/v1.0.0/#examples) from _Conventional Commits_ documentation.

Bump the package version in the [package.json](package.json) file and generate the [CHANGELOG.md](CHANGELOG.md) file with new release information, type the **standard-version** command to check first, type `npm run check-release` command in the terminal, and then add these changes to Git, committing the release like this:

```shell
npm run release
git commit -am "chore(release): v0.2.0"
```

The version above is the result of the `standard-version` command, and this is just an example version. The version must always be changed when a new release is made.

The next step is to create a tag and push the changes to the remote repository with the tag. The command should look like this:

```shell
git tag v0.2.0
git push origin --tag
```

After completing the above steps, you can verify the package version by entering this command in the terminal:

```shell
python -m setuptools_scm
```

Finally, create the build and update this build on [test.pypi.org][link-pypi-test-project] and [pypi.org][link-pypi-project], but first, make sure to check everything, and then proceed with the update.

Enter the following commands in the terminal:

```shell
rm -rf dist
python -m build
twine check dist/*
twine upload -r testpypi dist/*
twine upload dist/*
```

Remember, only the package owner can perform this operation and must have the secrets configured in the `.pypirc` file in the system.

## License

Package [mdsanima-cli][link-pypi-project] developed by [Marcin Różewski][link-mdsanima-github-account] is released under the terms of [Apache-2.0][link-github-repo-license] license.

[link-github-repo-license]: https://github.com/mdsanima-lab/mdsanima-cli/blob/main/LICENSE
[link-github-repo-stars]: https://github.com/mdsanima-lab/mdsanima-cli/stargazers
[link-pepy-total-downloads]: https://www.pepy.tech/projects/mdsanima-cli
[link-pypi-project]: https://pypi.org/project/mdsanima-cli
[link-pypi-test-project]: https://test.pypi.org/project/mdsanima-cli
[link-code-style-black]: https://github.com/psf/black
[link-mdsanima-github-account]: https://github.com/mdsanima
[link-mdsanima-x-account]: https://twitter.com/intent/follow?mdsanima&screen_name=mdsanima
[link-mdsanima-reddit-account]: https://reddit.com/r/mdsanima
[link-mdsanima-youtube-account]: https://youtube.com/mdsanima?sub_confirmation=1
[link-mdsanima-discord-account]: https://discord.gg/c3m7pTF
[link-mdsanima-twitch-account]: https://twitch.tv/mdsanima
