minification-station


Nameminification-station JSON
Version 0.1.4 PyPI version JSON
download
home_pagehttps://github.com/myinusa/minification-station
SummaryDesigned to process and combine multiple files within a specified directory into a single output file.
upload_time2024-10-03 20:06:58
maintainerNone
docs_urlNone
authormyinusa
requires_python<4.0,>=3.10
licenseMIT
keywords automation file processing minification text processing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

- [Minification Station](#minification-station)
  - [Table of Contents](#table-of-contents)
  - [Description](#description)
  - [Usage](#usage)
    - [Example Command](#example-command)
    - [Environment Variables](#environment-variables)
    - [Command-Line Arguments](#command-line-arguments)
  - [FAQ](#faq)
  - [Resources](#resources)
  - [Configuration](#configuration)
  - [Features](#features)
  - [Topics](#topics)
  - [Considerations](#considerations)

## 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.

<img src="./docs/output.gif" width="700" />


### Example Command
```sh
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

- [Python Documentation](https://docs.python.org/3/)
- [tqdm Library](https://pypi.org/project/tqdm/)
- [Logging in Python](https://docs.python.org/3/library/logging.html)

## 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

<!-- - Ensure the specified directory exists before running the script. -->

- 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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/myinusa/minification-station",
    "name": "minification-station",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "automation, file processing, minification, text processing",
    "author": "myinusa",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/08/06/4b22934a3f8af1eba27067dc11ce196b40a318713b7b51cf2e8567fd3a91/minification_station-0.1.4.tar.gz",
    "platform": null,
    "description": "# Minification Station\n\nMinification 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.\n\n## Table of Contents\n\n- [Minification Station](#minification-station)\n  - [Table of Contents](#table-of-contents)\n  - [Description](#description)\n  - [Usage](#usage)\n    - [Example Command](#example-command)\n    - [Environment Variables](#environment-variables)\n    - [Command-Line Arguments](#command-line-arguments)\n  - [FAQ](#faq)\n  - [Resources](#resources)\n  - [Configuration](#configuration)\n  - [Features](#features)\n  - [Topics](#topics)\n  - [Considerations](#considerations)\n\n## Description\n\nMinification 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.\n\n## Usage\n\nTo use Minification Station, follow these steps:\n\n1. Install the required dependencies by running `poetry install`.\n2. Run Poetry shell: `poetry shell`.\n3. Run the script using Poetry: `poetry run minification_station -d <DIRECTORY>`.\n4. 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.\n\n<img src=\"./docs/output.gif\" width=\"700\" />\n\n\n### Example Command\n```sh\npython3 -m minification_station.main -d /path/to/directory --program_lang python\n```\n\n### Environment Variables\n\n- `OUTPUT_PATH`: Path where the output file will be saved. Default is \"output\".\n\n### Command-Line Arguments\n\n- `-d, --directory`: Directory to traverse. Required.\n- `--program_lang`: Programming language (default: python). Optional.\n- `-o, --output`: Output file path. Optional.\n\n## FAQ\n\n**Q**: How do I specify different languages for processing? A: Use the `--program_lang` argument followed by the language name, e.g., `python`, `csharp`.\n\n**Q: Can I specify different file extensions or ignore certain files during traversal?**\nA: 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.\n\n**Q: How do I view logs generated by the script?**\nA: 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.\n\n## Resources\n\n- [Python Documentation](https://docs.python.org/3/)\n- [tqdm Library](https://pypi.org/project/tqdm/)\n- [Logging in Python](https://docs.python.org/3/library/logging.html)\n\n## Configuration\n\nYou can configure the script by modifying various parameters in the `config` directory:\n\n- **constants.py**: Contains default settings for file extensions, ignored files and folders, and size limits.\n- **args.py**: Defines command line arguments used to run the script.\n- **environment_setup.py**: Includes functions to initialize application environment, logging setup, and ensure output directories exist.\n- **logging/setup_logging.py**: Contains functions to set up logging configuration with options for file rotation, console output, and error handling.\n\n## Features\n\n- Traverse specified directory recursively.\n- Include or exclude files based on extensions.\n- Ignore specific folders during traversal.\n- Combine file content into a single output file.\n- Logging progress and errors for easy debugging.\n\n## Topics\n\n- File Processing\n- Directory Traversal\n- Logging in Python\n- Command Line Interface (CLI)\n\n## Considerations\n\n<!-- - Ensure the specified directory exists before running the script. -->\n\n- Be aware of the size limits to avoid processing files that are too large.\n- Customize configurations as needed for different environments or specific use cases.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Designed to process and combine multiple files within a specified directory into a single output file.",
    "version": "0.1.4",
    "project_urls": {
        "Changelog": "https://github.com/myinusa/minification-station/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/myinusa/minification-station/blob/main/README.md",
        "Homepage": "https://github.com/myinusa/minification-station",
        "Repository": "https://github.com/myinusa/minification-station"
    },
    "split_keywords": [
        "automation",
        " file processing",
        " minification",
        " text processing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d5214a851e47a28435e1980788adabf6ab0ead198c5d174b68e30e1b52db134c",
                "md5": "050d273c5430eddb6814a2cda7067a15",
                "sha256": "7a4cd0ae972680b5c22b31049b0277aceba825fff9f4ec4da1d9d0cf634e3e7d"
            },
            "downloads": -1,
            "filename": "minification_station-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "050d273c5430eddb6814a2cda7067a15",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 9760,
            "upload_time": "2024-10-03T20:06:57",
            "upload_time_iso_8601": "2024-10-03T20:06:57.204662Z",
            "url": "https://files.pythonhosted.org/packages/d5/21/4a851e47a28435e1980788adabf6ab0ead198c5d174b68e30e1b52db134c/minification_station-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08064b22934a3f8af1eba27067dc11ce196b40a318713b7b51cf2e8567fd3a91",
                "md5": "0ec5fbcefc0c8a29af595862d665bf82",
                "sha256": "a38b4ca5556bb8ab8ba296a23026cbf1dc50d89b3fa6dcaecf1b5680b0cc2e98"
            },
            "downloads": -1,
            "filename": "minification_station-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "0ec5fbcefc0c8a29af595862d665bf82",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 11509,
            "upload_time": "2024-10-03T20:06:58",
            "upload_time_iso_8601": "2024-10-03T20:06:58.876882Z",
            "url": "https://files.pythonhosted.org/packages/08/06/4b22934a3f8af1eba27067dc11ce196b40a318713b7b51cf2e8567fd3a91/minification_station-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-03 20:06:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "myinusa",
    "github_project": "minification-station",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "minification-station"
}
        
Elapsed time: 0.35202s