peasy-compress
Async Rust client for the Peasy Compress API -- compress, archive, and extract files with ZIP, TAR, gzip, Brotli, and Zstandard. Built with reqwest, serde, and tokio.
Built from Peasy Tools, a comprehensive file compression toolkit offering free online tools for creating and extracting archives across multiple formats. The glossary covers compression algorithms from classic DEFLATE to modern Brotli and Zstandard, while guides compare archive formats and explain lossless vs lossy compression strategies.
Explore compression formats at peasytools.com -- ZIP, TAR, Gzip, and more.
Table of Contents
- Install
- Quick Start
- What You Can Do
- API Client
- Learn More About Compression
- Also Available
- Peasy Developer Tools
- License
Install
[]
= "0.2.0"
= { = "1", = ["full"] }
Or via cargo:
Quick Start
use Client;
async
What You Can Do
Compression and Archive Tools
File compression reduces storage costs and speeds up network transfers. Archive formats like ZIP and TAR bundle multiple files into a single container, while compression algorithms like DEFLATE, Brotli, and Zstandard reduce the size of the archived data. Understanding which format to use -- ZIP for cross-platform compatibility, TAR+gzip for Unix workflows, or Brotli for web content delivery -- is critical for choosing the right tool for each task.
| Format | Type | Best For |
|---|---|---|
| ZIP | Archive + Compression | Cross-platform file sharing, per-file compression |
| TAR | Archive only | Unix/Linux bundles, combined with gzip or Brotli |
| gzip | Compression only | Single file compression, HTTP content encoding |
| Brotli | Compression only | Web assets, higher compression ratios than gzip |
| Zstandard | Compression only | Fast real-time compression, database backups |
use Client;
async
Learn more: ZIP Format Reference · TAR Format Reference · Archive Formats Compared
Browse Compression Reference Content
The compression glossary explains key concepts from basic archiving terminology to advanced algorithm details. Understanding the difference between lossless and lossy compression, how DEFLATE works under the hood, and when to choose Brotli over gzip helps developers make informed decisions about their compression pipelines.
| Glossary Term | Description |
|---|---|
| Archive | A single file containing multiple files and directory structures |
| TAR | Tape Archive format that bundles files without compression |
| Brotli | Google-developed compression algorithm optimized for web content |
| Lossless Compression | Compression that preserves all original data upon decompression |
| Zstandard | Facebook-developed algorithm balancing speed and compression ratio |
// Browse compression glossary terms programmatically
let glossary = client.list_glossary.await?;
for term in &glossary.results
// Read in-depth guides comparing archive formats
let guides = client.list_guides.await?;
for guide in &guides.results
Learn more: Archive Glossary · Brotli Glossary · Lossless vs Lossy Compression Guide
Search and Discovery
The unified search endpoint queries across all compression tools, glossary terms, guides, and supported file formats simultaneously. This is useful for building CLI tools, documentation search, or CI/CD integrations that need to find the right compression approach.
// Search across all compression tools, glossary, and guides
let results = client.search.await?;
println!; // Cross-content compression search results
Learn more: TAR Glossary · Lossless Compression Glossary · Zstandard Glossary
API Client
The client wraps the Peasy Tools REST API with strongly-typed Rust structs using serde deserialization.
use Client;
async
Available Methods
| Method | Description |
|---|---|
list_tools(&opts) |
List tools (paginated, filterable) |
get_tool(slug) |
Get tool by slug |
list_categories(&opts) |
List tool categories |
list_formats(&opts) |
List file formats |
get_format(slug) |
Get format by slug |
list_conversions(&opts) |
List format conversions |
list_glossary(&opts) |
List glossary terms |
get_glossary_term(slug) |
Get glossary term |
list_guides(&opts) |
List guides |
get_guide(slug) |
Get guide by slug |
list_use_cases(&opts) |
List use cases |
search(query, limit) |
Search across all content |
list_sites() |
List Peasy sites |
openapi_spec() |
Get OpenAPI specification |
Full API documentation at peasytools.com/developers/. OpenAPI 3.1.0 spec: peasytools.com/api/openapi.json.
Learn More About Compression
- Formats: ZIP · TAR · Gzip · All Formats
- Guides: Archive Formats Compared · Lossless vs Lossy Compression · All Guides
- Glossary: Archive · TAR · Brotli · Lossless Compression · Zstandard · All Terms
- API: REST API Docs · OpenAPI Spec
Also Available
| Language | Package | Install |
|---|---|---|
| Python | peasy-compress | pip install "peasy-compress[all]" |
| TypeScript | peasy-compress | npm install peasy-compress |
| Go | peasy-compress-go | go get github.com/peasytools/peasy-compress-go |
| Ruby | peasy-compress | gem install peasy-compress |
Peasy Developer Tools
Part of the Peasy Tools open-source developer ecosystem.
| Package | PyPI | npm | crates.io | Description |
|---|---|---|---|---|
| peasy-pdf | PyPI | npm | crate | PDF merge, split, rotate, compress -- peasypdf.com |
| peasy-image | PyPI | npm | crate | Image resize, crop, convert, compress -- peasyimage.com |
| peasy-audio | PyPI | npm | crate | Audio trim, merge, convert, normalize -- peasyaudio.com |
| peasy-video | PyPI | npm | crate | Video trim, resize, thumbnails, GIF -- peasyvideo.com |
| peasy-css | PyPI | npm | crate | CSS minify, format, analyze -- peasycss.com |
| peasy-compress | PyPI | npm | crate | ZIP, TAR, gzip compression -- peasytools.com |
| peasy-document | PyPI | npm | crate | Markdown, HTML, CSV, JSON conversion -- peasyformats.com |
| peasytext | PyPI | npm | crate | Text case conversion, slugify, word count -- peasytext.com |
License
MIT