packaging
Core Python utilities for versions, specifiers, markers, requirements, and metadata
Repository Health
Technical Analysis
packaging is the reference implementation of Python’s packaging interoperability specifications, maintained by the PyPA. It provides battle-tested building blocks for handling PEP 440 versions, version specifiers, environment markers, requirements, wheel tags, and core metadata.
Used under the hood by pip, build, and much of the modern Python packaging ecosystem, packaging turns fuzzy string handling — like parsing “pytest>=6.2.0; python_version<‘3.11’” or comparing “2.0.0rc1” against “2.0” — into correct, spec-compliant behavior so you never have to reimplement it yourself.
What You Get
- PEP 440 compliant Version parsing, normalization, and comparison
- SpecifierSet handling for version constraints like >=1.0,<2.0
- Environment marker evaluation (e.g. python_version, sys_platform)
- Requirement parsing for PEP 508 dependency strings
- Wheel compatibility tags and manylinux/musllinux platform detection
- Core metadata and pylock (PEP 751) parsing plus SPDX license helpers
Common Use Cases
- Comparing and sorting release versions in build or CI tooling
- Validating whether an installed version satisfies a dependency constraint
- Parsing dependency requirement strings and evaluating their markers
- Selecting compatible wheels for the current interpreter and platform
Under The Hood
Architecture — packaging is organized as a set of independent, single-responsibility modules under src/packaging/: version.py (PEP 440 Version and comparison keys), specifiers.py (SpecifierSet), markers.py and a hand-written _tokenizer.py/_parser.py pair that drive PEP 508 requirement and marker parsing, requirements.py, tags.py with _manylinux.py/_musllinux.py and _elffile.py for platform detection, plus metadata.py, pylock.py, and a licenses/ package backed by a generated _spdx.py table. Each module can be imported in isolation; there is no central runtime or app lifecycle, only pure functions and value objects.
Tech Stack — It is pure Python targeting 3.9+ (including free-threaded builds and PyPy) with zero runtime dependencies, built with the flit_core backend and calendar versioning (YY.N). Development tooling includes nox for task orchestration, pytest with hypothesis property tests and coverage, pre-commit hooks, ASV benchmarks, and Sphinx (furo) docs published to Read the Docs.
Code Quality — The codebase is fully type-annotated with a shipped py.typed marker and makes deliberate use of modern typing (TypedDict, NamedTuple, Literal, Self). Testing is extensive: 19 dedicated test modules plus property-based and platform-specific suites (manylinux, musllinux, pylock, metadata) exercising the interoperability specs. Naming is precise and consistent, and version-conditional shims (e.g. a fallback deprecated decorator before Python 3.13) are handled cleanly.
API Design — The public API is deliberately minimal and ergonomic: high-level entry points like parse(), Version, SpecifierSet, Requirement, and Marker do the right thing with a single call, hiding the tokenizer/parser machinery behind private underscore modules. Behavior follows the published PyPA specifications, so the library is largely self-documenting for anyone familiar with PEP 440/508, and the hosted documentation covers every module.
Used by 38 apps in this directory
Agno
Devops · AI Development · Automation
Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.
Apache Airflow
Data Engineering
Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.
ArchiveBox
Bookmarks Archiving
Self-hosted web archiving that saves HTML, PDFs, screenshots, media, and code in open formats you own forever
argilla
AI Development · Data Engineering
Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.
authentik
Authentication · Security
The self-hosted Identity Provider that replaces Okta, Auth0, and Entra ID with a unified SSO platform supporting SAML, OAuth2/OIDC, LDAP, RADIUS, and WebAuthn.
ClickHouse
Databases · Analytics · Data Engineering
Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.
CubeSandbox
Developer Tools · Security · AI Agents
Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.
deepagents
AI Agents · AI Development
The batteries-included Python agent harness — planning, sub-agents, filesystem, shell, memory, and skills bundled in, built on LangGraph.
Zen Browser
Browser
A Firefox-based browser that puts focus, privacy, and workflow front-and-centre without sacrificing compatibility