Package: mdsanima-cli
mdsanima-cliCommand-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 InstallationInstall or update the latest version using pip:python3-mpipinstall--upgrademdsanima-cliThe package is now installed, and you can start using it.CLI Terminal CommandsAfter installing the package, you can now use themdsanimacommand in the terminal, and the response will provide instructions on how to use these command-line tools. You can also use themdsalias, 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:mdsanimamain command showing helpmdsanima checkprint directory infomdsanima uuidrename to uuidmdsanima numberrename to seq numbersmdsanima logoappend a logomdsanima watermarkappend a watermarkmdsanima jpgconvert to jpgmdsanima pngconvert to pngmdsanima webpconvert to webpmdsanima pixelartgenerate pixel art 32pxmdsanima gridgenerate grid 2x2mdsanima thumbnailgenerate jpeg thumbnail 128pxmdsanima gifmakergenerate gif animation pixel artmdsanima resizeresizing to 512px widthmdsanima multigenerate multi resolutionmdsanima captionadding captionmdsanima bgadding backgroundmdsanima filteradding filtermdsanima cropcropping imageThepixelartcommand works in a folder that contains only.pngimages and converts these images into pixel art by creating a new file and appending the suffixpixelartto 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.DevelopmentHere are some helpful instructions in the development process of this Python package.Python SetupThis package is built using specific tools and will be published on PyPI using Twine. Instructions on how to activate thevirtual environmentfor this project and how to configure and build the package. We will use specific package versions andPython 3.11for now.Virtual EnvironmentMake sure you havevirtualenvinstalled on your system. If not, enter this command:python3.11-mpipinstallvirtualenvCreating and activating the development environment, and then installing the necessary packages, enter the following commands in the terminal:virtualenv--setuptools=68.2.2--wheel=0.41.2--pip=23.2.1--python=python3.11.venvsource.venv/bin/activate
pipinstall-rrequirements.txt-rrequirements-dev.txtAll dependencies for this project are specified in therequirements.*files and in the project's TOML configuration.You can install these dependencies using thepip 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 thepip install ".[dev]"command instead of specifying a-rflag 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 thisworkflowguide.Build PackageBuilding ourPythonpackage is done using thebuildmodule, which was previously installed as a requirement in therequirements-dev.txtfile when activating the development environment.To build the package, enter the following command in the terminal:python-mbuildAfter building, the package will be placed in a folder nameddist, and the filename will have the.whlextension, including the package name and version.Install PackageAfter building the package, you can install it by entering the following command in the terminal:pipinstall--force-reinstalldist/mdsanima_cli-0.2.0-py3-none-any.whlThe--force-reinstallflag 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 PackageAfter building and installing our package, we can test it. You can use the appropriateCLIcommand mentioned above or test individual modules by entering the following command in the terminal:python-mmdsanima_cli.commands.pixelartYou can also run and test before building and installing the package, type in the terminal:python3src/mdsanima_cli/commands/pixelart.pyAfter running the above command, you will test only the selected module.Extracts VersionThesetuptools-scmtool allows you to extract thePythonpackage version fromgitinstead of declaring it as a version argument.If you need to confirm which version string is being generated, you can use thesetuptools-scmtool, which will display the current version you are working with. Enter the following command in the terminal:python-msetuptools_scmCheck thepyproject.tomlfile and thisinstructionfor more info.Creating ReleaseBelow is the instruction on how to create a release version of our Python package.Here are the steps to create a release version:Add new code to the packageTest new functionalityCommit the changesBump the package versionGenerate the CHANGELOG.md fileCommit the releaseAdd and push the new tagBuild and Update on PyPIThis is done manually for now, but we plan to set up aGitHub Actionworkflow for testing and automatic release version creation in the future.Conventional CommitsIn this project, we useConventional Commits- 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:gitcommit-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 VersionCheck thepackage.jsonfile in thestandard-versionsection and in the types lists for the first string that you can use in the commit message or check theexamplesfromConventional Commitsdocumentation.Bump the package version in thepackage.jsonfile and generate theCHANGELOG.mdfile with new release information, type thestandard-versioncommand to check first, typenpm run check-releasecommand in the terminal, and then add these changes to Git, committing the release like this:npmrunrelease
gitcommit-am"chore(release): v0.2.0"The version above is the result of thestandard-versioncommand, 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:gittagv0.2.0
gitpushorigin--tagAfter completing the above steps, you can verify the package version by entering this command in the terminal:python-msetuptools_scmFinally, create the build and update this build ontest.pypi.organdpypi.org, but first, make sure to check everything, and then proceed with the update.Enter the following commands in the terminal:rm-rfdist
python-mbuild
twinecheckdist/*
twineupload-rtestpypidist/*
twineuploaddist/*Remember, only the package owner can perform this operation and must have the secrets configured in the.pypircfile in the system.LicensePackagemdsanima-clideveloped byMarcin Różewskiis released under the terms ofApache-2.0license.