Skip to main content

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.

Example Command

python3 -m minification_station.main -d /path/to/directory --program_lang python

Environment Variables

  • OUTPUT_PATH: Path where the output file will be saved. Default is "output".

Command-Line Arguments

  • -d, --directory: Directory to traverse. Required.
  • --program_lang: Programming language (default: python). Optional.
  • -o, --output: Output file path. Optional.

FAQ

Q: How do I specify different languages for processing? A: Use the --program_lang argument followed by the language name, e.g., python, csharp.

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.

Metadata

Release files for minification-station 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minification-station 0.1.4
File Size Uploaded
minification_station-0.1.4.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minification-station 0.1.4
File Interpreter ABI Platform
minification_station-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / minification_station-0.1.4.tar.gz

Download URL minification_station-0.1.4.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a38b4ca5556bb8ab8ba296a23026cbf1dc50d89b3fa6dcaecf1b5680b0cc2e98
BLAKE2b-256 checksum
How to use checksums
08064b22934a3f8af1eba27067dc11ce196b40a318713b7b51cf2e8567fd3a91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.14 Linux/5.15.153.1-microsoft-standard-WSL2

Release files / minification_station-0.1.4-py3-none-any.whl

Download URL minification_station-0.1.4-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a4cd0ae972680b5c22b31049b0277aceba825fff9f4ec4da1d9d0cf634e3e7d
BLAKE2b-256 checksum
How to use checksums
d5214a851e47a28435e1980788adabf6ab0ead198c5d174b68e30e1b52db134c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.14 Linux/5.15.153.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page