Stdlib injectable surfaces (use-case catalog)
Living inventory of Python standard-library capabilities mapped to use-case
injectable packages in pyiv—not 1:1 wrappers of os / sys / io module names.
Status values:
shipped — public API exists with Real + test double (or equivalent)
gap — planned / in progress
wont — deliberately not wrapped (see Won’t wrap)
Surface template
Each use-case package should ship: narrow Protocol/ABC, Real* adapter (instance
state only), Memory/Synthetic* double (no system residue), optional composites
(mounts, archives-as-FS), file-likes where I/O applies, and doctest-backed docs.
Option bags are frozen dataclasses with boring field types (pydantic-friendly
without a pydantic dependency). See .cursor/skills/public-types/SKILL.md.
Catalog by use case
Use case package |
Stdlib sources (concepts) |
Types |
Status |
|---|---|---|---|
|
|
|
shipped |
|
|
|
shipped |
|
|
|
shipped |
|
|
|
shipped |
|
|
|
shipped |
|
|
|
shipped |
|
|
|
shipped |
|
|
|
shipped |
|
|
|
shipped |
Legacy top-level modules (pyiv.filesystem, pyiv.clock, pyiv.datetime_service)
re-export from use-case packages for one major cycle.
Stdlib module → bucket
Stdlib |
Bucket |
Notes |
|---|---|---|
|
|
Not a god |
|
|
Archives as |
|
|
|
|
|
|
|
|
|
|
|
Injectable |
|
|
Signals deferred until a consumer needs them |
|
|
Configure stdlib hierarchy; Console ≠ Logger |
|
|
|
|
|
|
|
|
|
|
|
Won’t wrap
math, collections, itertools, functools, operator — pure helpers; no I/O or process edge
typing, dataclasses, enum, abc — language tooling
asyncio event-loop ownership — note gaps; no fake loop in early phases
threading / multiprocessing primitives — prefer real sync; don’t inject Lock by default
ctypes, importlib machinery, gc, inspect — too low-level / reflective
God objects named
Sys,Os,Io— split by use case insteadSecond logging backend that bypasses stdlib
logging(breaks library interop)DB/S3/Postgres filesystems in core — implement
Filesystemexternally; useMountFilesystem
Third-party displacements
Convenience / test helper |
Prefer |
|---|---|
|
|
|
|
|
|
Hand-rolled |
|
Ad-hoc |
|
Ad-hoc |
|
Design rules (reminder)
Instances over module globals / monkeypatches
One job per injectable type
Narrow purpose APIs over full stdlib module surfaces
Option bags: frozen dataclasses; services: Protocol/ABC
Core stays stdlib-only (see package-boundaries skill)