https://github.com/milesbarr/minifier
A Python tool for minifying web assets.
https://github.com/milesbarr/minifier
css html json minification minifier minify python python3 svg web-app-manifest website xhtml xml
Last synced: 6 months ago
JSON representation
A Python tool for minifying web assets.
- Host: GitHub
- URL: https://github.com/milesbarr/minifier
- Owner: milesbarr
- License: mit
- Created: 2024-01-06T05:43:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-07T13:16:23.000Z (7 months ago)
- Last Synced: 2025-06-13T10:50:31.597Z (7 months ago)
- Topics: css, html, json, minification, minifier, minify, python, python3, svg, web-app-manifest, website, xhtml, xml
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Minifier
A Python tool for minifying website assets by removing unnecessary whitespace,
comments, and other redundant content while preserving functionality. Ideal for
web developers looking to optimize site performance.
## Features
- Minifies common web file formats: HTML, CSS, JSON, and XML
- Preserves full functionality while reducing file size
- Simple command-line interface
- Can be used as a Python library
- Fast and lightweight, with minimal dependencies
## Supported Formats
- HTML (`.html`, `.htm`, `.xhtml`)
- CSS (`.css`)
- JSON (`.json`, `.webmanifest`)
- XML (`.xml`, `.rss`, `.atom`, `.svg`)
## Installation
Install directly from GitHub:
```bash
pip install git+https://github.com/milesbarr/minifier@main
```
Or clone the repository and install locally:
```bash
git clone https://github.com/milesbarr/minifier.git
cd minifier
pip install .
```
## Usage
### Command-Line Interface
Minify a file:
```bash
python -m minifier -i input.html -o output.html
```
### Python API
Minify a file:
```python
from minifier import minify_file
minify_file("input.html", "output.html")
```
## License
This project is licensed under the [MIT License](LICENSE).