Skip to main content

Minification Station is a Python script designed to process and combine multiple files within a specified directory into a single output file. This tool is particularly useful for reducing the size of large codebases or collections of text files by removing unnecessary line breaks, comments, etc.

Project description

Minification Station

Minification Station is a Python script designed to process and combine multiple files within a specified directory into a single output file. This tool is particularly useful for reducing the size of large codebases or collections of text files by removing unnecessary line breaks, comments, etc.

Table of Contents

Description

Minification Station is a versatile tool that processes files in a specified directory, combining them into a single output file. It supports various configurations such as specifying the directory to traverse, file extensions to include, and folders to ignore during traversal. The script logs progress and errors, ensuring transparency and ease of debugging.

Usage

To use Minification Station, follow these steps:

  1. Install the required dependencies by running poetry install.
  2. Run Poetry shell: poetry shell.
  3. Run the script using Poetry: poetry run minification_station -d <DIRECTORY>.
  4. The script will process all files in the specified directory and write the combined content to an output file named after the current date and time, appended with the directory's base name.

Command Line Arguments

  • -d, --directory: Specifies the directory to traverse (required).

FAQ

Q: Can I specify different file extensions or ignore certain files during traversal? A: Yes, you can customize these settings by modifying the script accordingly. Refer to the configuration section for more details on how to modify these parameters.

Q: How do I view logs generated by the script? A: Logs are written to a file named main.log in the 'logs' directory. You can also view real-time updates via console output if you prefer.

Resources

Configuration

You can configure the script by modifying various parameters in the config directory:

  • constants.py: Contains default settings for file extensions, ignored files and folders, and size limits.
  • args.py: Defines command line arguments used to run the script.
  • environment_setup.py: Includes functions to initialize application environment, logging setup, and ensure output directories exist.
  • logging/setup_logging.py: Contains functions to set up logging configuration with options for file rotation, console output, and error handling.

Features

  • Traverse specified directory recursively.
  • Include or exclude files based on extensions.
  • Ignore specific folders during traversal.
  • Combine file content into a single output file.
  • Logging progress and errors for easy debugging.

Topics

  • File Processing
  • Directory Traversal
  • Logging in Python
  • Command Line Interface (CLI)

Considerations

  • Be aware of the size limits to avoid processing files that are too large.
  • Customize configurations as needed for different environments or specific use cases.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minification_station-0.1.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

minification_station-0.1.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file minification_station-0.1.1.tar.gz.

File metadata

  • Download URL: minification_station-0.1.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for minification_station-0.1.1.tar.gz
Algorithm Hash digest
SHA256 72c3cb85ac544d60e55ae5a52a35751cb6ff1bffb21b50930a841191737c1639
MD5 2e67b6e04d4e344ff26c3e61b771eb78
BLAKE2b-256 ed51dc6577e1f3881f50eaeb511a58af53cb56573b5cffa6a803fbd4751ce514

See more details on using hashes here.

Provenance

File details

Details for the file minification_station-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: minification_station-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for minification_station-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e556b20bc2508f9359b87c0eaa29374beb54e34bde35a105ac01f7936f74f1d
MD5 fbaefa5070586c8a2da1051992ec98bf
BLAKE2b-256 78f8ad305e0fa7e9f809493a36ae776bc0ef8793422b546d6cf34c02d4ef19a8

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page