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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| p4n4_lib-0.4.0.tar.gz | 85.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| p4n4_lib-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 124.8 kB
Release files / p4n4_lib-0.4.0.tar.gz
| Download URL | p4n4_lib-0.4.0.tar.gz |
|---|---|
| Size | 85.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8a144147267a53d5b70f4697b04e9d5b3ed5bbdb8da9b045a119fe1c2f86744
|
|
BLAKE2b-256 checksum How to use checksums |
1546d86fec97b01484cf9a58a3918cd2c76e9e7f91703cbd7e3e0aecd0452114
|
| 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 16, 2026.
Transparency logRelease files / p4n4_lib-0.4.0-py3-none-any.whl
| Download URL | p4n4_lib-0.4.0-py3-none-any.whl |
|---|---|
| Size | 38.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d68ec339e07f5213256437e8d41ac447d58c1451890b08633508bef390fde3a7
|
|
BLAKE2b-256 checksum How to use checksums |
b98f021f7d0b8170361b0944ebbf7f16bf8a00d0aad3350daff98ae3cc66721e
|
| 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 16, 2026.
Transparency log