py
Legacy Python support library for path, ini-config, and code introspection utilities
Repository Health
Technical Analysis
py is a small Python support library that grew out of the early pytest project, bundling a handful of cross-platform utilities: py.path for uniform local and SVN path objects, py.iniconfig for parsing .ini files, py.apipkg for lazy, explicit API control, and py.code for dynamic code generation and introspection. It is officially in maintenance mode — the project’s own README tells users not to adopt it for new code and instead points to the standalone successors (pathlib, iniconfig, apipkg) that absorbed each piece. It remains published mainly so that older packages and pinned environments that still import py continue to work.
What You Get
py.path.localandpy.path.svnwc— object-oriented, cross-platform path manipulation predating widespread pathlib adoptionpy.iniconfig— a minimal parser for .ini-style configuration filespy.apipkg— a mechanism for declaring a package’s public API lazily, deferring submodule imports until first accesspy.code— internals for dynamic code compilation, traceback formatting, and introspection (later folded into pytest itself)- A stable, dependency-free install that keeps decade-old codebases importing
pyworking without modification
Common Use Cases
- Keeping old pytest plugins or internal tooling that still
import pyrunning without a rewrite - Maintaining pinned CI environments where downgrading or removing
pywould break other pinned dependencies - Reading legacy code that references
py.pathorpy.codewhile planning a migration topathlib/iniconfig/apipkg - Auditing a dependency tree for an inherited, unmaintained transitive dependency before replacing it
Under The Hood
Architecture: py is organized as a namespace package (py/) with independent subpackages per concern — _path (local and SVN path objects), _iniconfig, _code (introspection and traceback formatting, ~800 lines in code.py), _log, _io, and _process (subprocess helpers) — wired together through py/__init__.py’s lazy apipkg-style export table rather than direct submodule imports, so each piece can be used independently without pulling in the rest. Tech Stack: pure Python 2/3-compatible code with zero third-party runtime dependencies, built with setuptools and setuptools_scm for version derivation; the pyproject.toml only declares build-system requirements, keeping the installed package dependency-free. Code Quality: the testing/ directory holds 31 test files mirroring the module layout (testing/path, testing/code, testing/io_, testing/log, testing/process), run via tox across multiple Python versions per tox.ini; the code predates modern type hints and uses classic Python 2-era idioms, and the README itself flags the project as frozen in maintenance mode with no further feature development. API Design: each module exposes a small, focused surface (e.g., py.path.local(...) mirrors pathlib.Path but predates it), which made py convenient in the pytest-2.x era; today the maintainers explicitly steer users toward the standalone pathlib, iniconfig, and apipkg packages that superseded these APIs.
Used by 3 apps in this directory
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.
Dragonfly
Databases · Developer Tools · Devops
A modern Redis and Memcached replacement engineered for multi-core servers — delivering 25x more throughput, better cache hit rates, and up to 80% lower memory consumption with full API compatibility.
SigNoz
Monitoring · Analytics
Self-host your entire observability stack — logs, metrics, traces, and LLM monitoring — in one OpenTelemetry-native platform, without the Datadog bill.