Skip to main content

p4n4-lib

Shared Python library mediating between P4N4 stacks and clients (p4n4-cli, p4n4-api, p4n4-dashboard).

Framework-free by design: no CLI/TUI/web dependencies, only pyyaml. Presentation (prompts, tables, colors) stays in the clients.

Modules

Module Purpose
p4n4_lib.manifest .p4n4.json manifest: find (walk-up), load, save, create, and checks for the optional dashboard block
p4n4_lib.env Dotenv read/write, template-preserving writes
p4n4_lib.layers Layer registry: repo URLs, copy paths, required files/env keys per layer (iot, ai, extras, dashboard), files and keys per Compose profile, opt-in layers, and legacy layers (edge, now ai's ei-runner profile)
p4n4_lib.layout Project layout: flat for single-layer projects, per-layer subdirectories for multi-layer; dependency order; which layer runs the inference runner
p4n4_lib.migrate Move a legacy edge layer into ai (the inference runner) or extras (other services), keeping what it replaces in edge.pre-migrate/
p4n4_lib.scaffold Fetch stack sources (local path or shallow clone) and copy into a project; the project's .gitignore
p4n4_lib.validate Pure project validation returning (passed, errors) check lists; template projects are checked against their .env.example instead of the base stack
p4n4_lib.secrets Token generation and the rotatable-key policy
p4n4_lib.compose Docker Compose subprocess wrappers (up, down, ps, logs, enabled_services)

Stack repo URLs live in p4n4_lib/sources.yaml.

Install

pip install p4n4-lib
pip install -e path/to/lib           # monorepo development

See CHANGELOG.md for release notes.

Development

pip install -e ".[dev]"
pytest
ruff check .

License

MIT

Metadata

Release files for p4n4-lib 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for p4n4-lib 0.4.1
File Size Uploaded
p4n4_lib-0.4.1.tar.gz 87.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for p4n4-lib 0.4.1
File Interpreter ABI Platform
p4n4_lib-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 126.3 kB

Release files / p4n4_lib-0.4.1.tar.gz

Download URL p4n4_lib-0.4.1.tar.gz
Size 87.1 kB
Tags Source
SHA-256 checksum
How to use checksums
00c311e4da42df0abf33e29642c8d4607544cbbc8846980e541559a41e8fc45f
BLAKE2b-256 checksum
How to use checksums
ac1cdee687a6f94b201936fe7aa5ea694bdb2966e1eeed1a1739aa3315b05356
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / p4n4_lib-0.4.1-py3-none-any.whl

Download URL p4n4_lib-0.4.1-py3-none-any.whl
Size 39.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ada7c83221d528965c2f56f24d03e73f7e64dbb6e306bbb6e73c59e30b0206a8
BLAKE2b-256 checksum
How to use checksums
bd8b6e7c30f3720a96ea24b90197f45db3a558d44a873a767a89e597c439d2dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page