micompress
Compress images, PDFs, video, audio, documents & archives from your terminal or Python. Powered by micompress.com.
A tiny zero-dependency client (standard library only) that sends your file to the MiCompress engine and writes back the optimized result.
pip install micompress
CLI usage
micompress photo.jpg # → photo-min.jpg
micompress *.png --preset extreme
micompress report.pdf slides.pptx -o out/
micompress big.jpg --max-width 1920 --json
| Option | Description |
|---|---|
-o, --output DIR |
Write results to a directory (default: alongside input, -min suffix) |
-p, --preset |
lossless · recommended (default) · extreme |
--max-width PX |
Resize images down to a maximum width |
--api-key KEY |
Personal API key from micompress.com/account (or set MICOMPRESS_API_KEY) |
--token JWT |
Legacy login token; prefer --api-key |
--api URL |
Override API base URL |
--json |
Machine-readable output |
-q, --quiet |
Only print errors |
API key
Small files work without an account. For bigger files and a monthly allowance, use your
personal API key (mc_…), shown on your account page —
creating an account is free.
export MICOMPRESS_API_KEY=mc_your_key_here
micompress big-video.mp4
# or per command (the flag wins over the environment variable)
micompress big-video.mp4 --api-key mc_your_key_here
| Plan | Compressions per month | Notes |
|---|---|---|
| No key (anonymous) | Anonymous limits | Small files only |
| Free account | 50 via the API | Files up to 100 MB |
| Plus ($9.99/mo) | 1,000 | Shared with website usage |
| Pro ($19.99/mo) | 5,000 | Shared with website usage |
When the allowance is used up the CLI reports API_QUOTA_REACHED (free) or
USAGE_LIMIT_REACHED (paid). See micompress.com/plans.
Keep the key secret — anyone who has it can spend your quota.
Python API
from micompress import compress_file
data, meta = compress_file("photo.jpg", preset="extreme")
open("photo-min.jpg", "wb").write(data)
print(meta["savedPercent"], "% smaller")
# With an API key (sent as the X-API-Key header)
data, meta = compress_file("big.pdf", api_key="mc_your_key_here")
Supported formats
Image (jpg, png, webp, gif, tiff, avif, svg, heic, psd, raw…), PDF & Office docs, video (mp4, mov, mkv, webm…), audio (mp3, wav, flac…), archives (zip, 7z, tar, gz). Full list: https://micompress.com/all-tools
Requirements
Python 3.8+. No third-party dependencies.
License
MIT © MiCompress
Prefer a web UI or bigger batches? Use micompress.com.
Metadata
Release files for micompress 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| micompress-0.1.1.tar.gz | 8.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| micompress-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / micompress-0.1.1.tar.gz
| Download URL | micompress-0.1.1.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e884ac2913d5d68b0656e980784a109beb8c6e179f6e63e795dc0578fcd10081
|
|
BLAKE2b-256 checksum How to use checksums |
fe082a1a5a0cf28db6e3a213de8f25d121ef4e4c8e39f82916d9af07321f3cec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / micompress-0.1.1-py3-none-any.whl
| Download URL | micompress-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
374e4fcefa7b27b2f7f0fee56cb0a71d0da0b59c4f0ffcedbb6d0bd90fc2f268
|
|
BLAKE2b-256 checksum How to use checksums |
bcb4ef96a12ba6b9ffe71c52ee722ad98b8398e6a20dd1a2e0ad9c071960a27a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Security for micompress 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.