YantrikDB/packs
Sign in
officialyantrikdbsigned

python-stdlib

yantrik/python-stdlib@0.1.0·377 facts·1832 KB·8 downloads·by spranab

The Python 3.13.5 standard library's actual API surface, generated from the interpreter itself: every signature via inspect.signature (correct by construction, never from memory), CPython's own docstring summaries, plus authored recipes for the tasks agents actually do. Aimed at the measured failure mode of local models — invented imports and wrong signatures.

covers

Python standard library function and class signatures · Python file, path and subprocess operations · Python text, JSON, CSV and regular expression handling · Python dates, times, collections and itertools · Python logging, testing mocks and concurrency futures

rules this pack installs (8)

Injected on every turn while mounted. Shown verbatim — a pack's rules are public by design.

Verify the API before writing the call: Before calling a standard-library function, recall its signature from this pack. If the pack has no record of the function for this Python version, say so and use a documented alternative — never write a call from memory alone.
No invented imports: Import only modules that exist: the standard library as recorded here, or third-party packages the project's dependency file already declares. Never import `retrying`, `dateutils`, or any package whose existence you have not confirmed.
Keyword names come from the signature: `subprocess.run` captures with `capture_output=True`, not `output=True`. `json.dumps` indents with `indent=2`, not `pretty=True`. When a keyword argument is not in the recalled signature, it does not exist.
Prefer the modern spelling: `pathlib.Path` over `os.path` string juggling; `subprocess.run` over `os.system` and `subprocess.call`; `datetime.now(timezone.utc)` over the deprecated `utcnow()`; f-strings over `%` and `.format()`; explicit `encoding="utf-8"` on every text file open.
Commands are lists, queries are parameters: `subprocess.run` takes a list, never a shell string built from variables. `sqlite3` takes `?` placeholders, never an f-string. Both rules exist because the interpolated version runs fine until the first hostile input.
Errors are handled at the narrowest useful scope: Catch the specific exception the call raises (`FileNotFoundError`, `CalledProcessError`, `json.JSONDecodeError`) — a bare `except:` or `except Exception` around a block hides the defect this pack exists to prevent.
Version-gate anything newer than 3.8: `itertools.batched` (3.12), `hashlib.file_digest` (3.11), `dataclass slots=True` (3.10), `dirs_exist_ok` (3.8). If the project targets an older Python, use the compatible spelling instead of the newest one.
State the source of an uncertain claim: If asked about an API this pack does not cover, prefix the answer with the fact that it is from model memory, unverified for the local Python version.

evaluation notes

skills.constitution — pack installs 8 always-on rule(s); they are shown verbatim on the listing for review

install

Native client — verifies against the registry, then installs:

curl -O https://packs.yantrikdb.com/client/yantrik_pack_client.py
python yantrik_pack_client.py install yantrik-python-stdlib

Manual — download first, then:

yantrikdb pack info python-stdlib-0.1.0.ydbpack
yantrikdb pack install python-stdlib-0.1.0.ydbpack

Verify any copy of this file, wherever it came from:

curl "https://packs.yantrikdb.com/api/v1/verify?sha256=ba3b129106fe6e8e9bcd035b0165c6053b3c475d533f97558d387890b4b14d54"

get it

Download 0.1.0
sha256
ba3b129106fe6e8e9bcd035b0165c6053b3c475d533f97558d387890b4b14d54
digest
blake3:c9f1407f90a8ec5e25b5d3f4f4eee775c2e3242b44e2b720b0e4e889c5fc73f9
signer
13a9232bc7829ea6a03e4bd6a0706c08f80ff4a2ecc83fd10062314acfb59683