# rust-lang/flate2-rs

DEFLATE, gzip, and zlib bindings for Rust

Repository: https://github.com/rust-lang/flate2-rs
Canonical: https://ross.abutalabs.com/products/flate2-rs
Homepage: https://docs.rs/flate2
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: zlib, gzip, deflate, zlib-ng
Last push: 2026-08-26T03:10:50+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 57, longevity 100
- inputs: {"age_days": 4430, "days_push": 7, "days_rel": 211, "gap_med": 38, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1120, forks 204 (observed 2026-08-28T04:03:39.598378+00:00)

## What it is
flate2 is a Rust library for streaming compression and decompression of DEFLATE-based formats: raw DEFLATE, zlib, and gzip. It supports multiple backends including pure-Rust miniz_oxide, zlib-rs, and C libraries like zlib and zlib-ng, selectable via Cargo feature flags.

## Use cases
- compress and decompress gzip files in Rust
- read and write zlib streams
- compress data with DEFLATE in Rust
- choose a fast zlib backend like zlib-ng or zlib-rs
- stream-compress data without loading it all in memory
- avoid needing a C compiler for compression in Rust

## When to choose
- you need gzip, zlib, or DEFLATE support in a Rust project
- you want a pure-Rust default backend with optional high-performance C backends
- you need streaming Read/Write-based compression APIs
- you want to avoid duplicate zlib dependencies via zlib-ng-compat

## When to avoid
- you need non-DEFLATE formats like zstd, bzip2, or lz4
- you are not working in Rust
- you need archive formats like tar or zip (combine with dedicated crates)

## Facets
- artifact type: library
- maturity: stable
- function: compression, file-system, developer-tools
- domain: files, developer-tools, cross-platform
- platform: rust, cross-platform
- tags: deflate, gzip, zlib, zlib-ng, miniz-oxide, streaming-compression, rust-crate

## Member repositories
- rust-lang/flate2-rs (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:39.598378+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:41:07.321958+00:00, confidence not recorded.
  - readme: https://github.com/rust-lang/flate2-rs (fetched 2026-08-28T04:03:39.598378+00:00, sha d63f220fe37d)
  - homepage: https://docs.rs/flate2 (fetched 2026-08-29T12:45:02.599932+00:00, sha 5aff2b3d7cc2)
  - site_page: https://docs.rs/ (fetched 2026-08-29T12:45:02.609206+00:00, sha e52d0767739d)
  - site_page: https://docs.rs/crate/flate2/latest (fetched 2026-08-29T12:45:02.610915+00:00, sha 7e26082f1dc9)
  - site_page: https://docs.rs/document-features/^0.2 (fetched 2026-08-29T12:45:02.612671+00:00, sha 69b8abc187ee)
  - site_page: https://docs.rs/crate/flate2/latest/features (fetched 2026-08-29T12:45:02.614434+00:00, sha 469ec8923e78)
  - site_page: https://docs.rs/about (fetched 2026-08-29T12:45:02.616019+00:00, sha 29ab7986fbf5)
  - site_page: https://docs.rs/about/badges (fetched 2026-08-29T12:45:02.617532+00:00, sha 6588cac258af)
  - site_page: https://docs.rs/about/builds (fetched 2026-08-29T12:45:02.619154+00:00, sha 811231ca4680)
  - site_page: https://docs.rs/about/metadata (fetched 2026-08-29T12:45:02.620984+00:00, sha 0dcdccb2b2b2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
