This is a collection of Python scripts to automate tasks.
Scripts are fully tested, linted, and compatible with both direct execution and Python's module runner (-m).
- scripts/trim_filenames.py: Recursively removes a specified number of characters from the beginning of filenames in a directory and its subdirectories.
- scripts/mp3_metadata_stripper.py: Recursively removes metadata from mp3 and m4a files in a directory and its subdirectories.
- scripts/cbz_processor.py: Compresses and optimizes CBZ files in a directory (see script for details).
- Python 3.6+
source .venv/bin/activate
pip install -r requirements.txtYou can run any script directly or as a module:
python -m scripts.trim_filenames
python -m scripts.mp3_metadata_stripper
python -m scripts.cbz_processorTo check code quality and style (using your project's .pylintrc):
pylint --rcfile=.pylintrc scripts testsTo run all tests and check code coverage:
pytest --maxfail=1 --disable-warnings --cov=scripts --cov-report=term-missingYou can also run coverage for a specific test file:
pytest --cov=scripts tests/test_trim_filenames.py