distro

Linux distribution detection library and CLI, replacing Python's removed platform.linux_distribution()

Library
PyPI
v1.9.0
282stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
62/100Good
Development Activity52
Maintenance40
Community76
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
72/100Good
Architecture70
Code Quality76
Innovation55
Learning Curve88

distro is the community-maintained replacement for Python’s platform.linux_distribution() function, which was deprecated in Python 3.5 and removed entirely in Python 3.8. It reliably detects the Linux/BSD distribution a program is running on — reading /etc/os-release, LSB release data, and distro-specific release files — and exposes machine-readable IDs, version strings, and human-readable names through a small Python API.

With over 90 million weekly downloads, distro has become a near-ubiquitous transitive dependency, pulled in by pip, OpenAI’s Python SDK, and countless other tools that need to branch behavior based on the host Linux distribution (e.g. choosing a package manager, picking a prebuilt binary, or tailoring installation instructions).

What You Get

  • distro.id(), distro.version(), distro.name() and related functions for distro identification
  • A LinuxDistribution class for advanced use cases needing custom release-file paths
  • A command-line interface (python -m distro) that prints detected distro info as JSON
  • Consistent parsing across os-release, LSB release, and legacy distro-specific release files
  • Zero required runtime dependencies beyond the Python standard library

Common Use Cases

  • Package managers and installers (like pip) selecting distro-appropriate binary wheels or repositories
  • CLI tools tailoring setup instructions or error messages to the user’s specific Linux distribution
  • SDKs (such as OpenAI’s Python client) including distro/OS metadata in request telemetry or user-agent strings
  • System administration scripts branching logic based on whether they’re running on Debian, Fedora, Alpine, etc.

Under The Hood

Architecture: The library is essentially one module, src/distro/distro.py (~1,500 lines), centered on a LinuxDistribution class that tries multiple detection strategies in priority order: parsing /etc/os-release (the modern systemd standard), falling back to lsb_release command output, and finally checking a table of legacy distro-specific release files (e.g. /etc/redhat-release, /etc/debian_version). Module-level convenience functions (id(), version(), name(), etc.) wrap a lazily-instantiated singleton of this class for the common case, while __main__.py exposes the same data through a CLI entry point.

Tech Stack: Pure Python standard library — no runtime dependencies at all — using argparse for the CLI, subprocess to shell out to lsb_release when needed, and re/shlex for parsing release-file formats. Packaging uses a standard pyproject.toml with setuptools as the build backend, targeting broad Python version compatibility given its role as a near-universal transitive dependency.

Code Quality: tests/test_distro.py exercises detection logic against a tests/resources/ fixture directory of real-world os-release/lsb_release samples from dozens of actual distributions, which is an effective strategy for a library whose whole job is correctly parsing heterogeneous real-world file formats. The module is fully type-hinted and includes deprecation warnings for older function names, showing deliberate API stewardship across the multi-year life of the project.

API Design: The public API deliberately mirrors the shape of the removed platform.linux_distribution() tuple/function pattern to minimize migration friction for existing codebases, while module-level functions like distro.id() require zero setup — no client construction, no configuration object — making it essentially frictionless to adopt as a dependency, which likely explains its near-ubiquitous presence as a transitive dependency across the Python packaging ecosystem.

Used by 10 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
68%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,687

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
67
Dependency
Built with
Python68%
TypeScript31%
Updated today
C++
69%
Apache 2.0

ClickHouse

Databases · Analytics · Data Engineering

49,325

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
68
Dependency
Built with
C++69%
Python13%
Updated today
Python
63%
Apache 2.0

GPT Researcher

Productivity · AI Assistants

29,039

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

View details
88
Repo Health
91
Technical
64
Dependency
Built with
Python63%
TypeScript23%
Updated 1 months ago
TypeScript
91%
Apache 2.0

Helicone

Monitoring · AI Development · Analytics

6,083

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
62
Repo Health
81
Technical
66
Dependency
Built with
TypeScript91%
Updated 3 days ago
Python
83%
Apache 2.0

knowhere

AI Development · Developer Tools

2,515

Transform messy, unstructured documents into persistent, navigable memory that AI agents can actually use.

View details
83
Repo Health
75
Technical
70
Dependency
Built with
Python83%
HTML16%
Updated today
TypeScript
97%
MIT

Promptfoo

AI Development

24,362

An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.

View details
90
Repo Health
73
Technical
68
Dependency
Built with
TypeScript97%
Updated yesterday
TypeScript
98%
Apache 2.0

rowboat

AI Assistants · AI Development

17,323

Build, test, and deploy multi-agent AI workflows with a visual editor, RAG data sources, MCP tool integration, and a production-ready REST API.

View details
85
Repo Health
72
Technical
65
Dependency
Built with
TypeScript98%
Updated today
Python
94%
Apache 2.0

SWIRL

Search · Databases · Data Engineering

3,039

Federated AI search and RAG across 100+ enterprise sources—no data extraction, no vector database required.

View details
77
Repo Health
83
Technical
65
Dependency
Built with
Python94%
Updated 2 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search