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.2

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.2
File Size Uploaded Provenance Actions
p4n4_lib-0.4.2.tar.gz 87.8 kB With provenance Details for p4n4_lib-0.4.2.tar.gz

Built distribution (wheel)

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

Total release size: 127.3 kB

Release files / p4n4_lib-0.4.2.tar.gz

Download URL p4n4_lib-0.4.2.tar.gz
Size 87.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1f79db76ca2f5c2e9d19491abde5ffd060493d02aa057f131a8fcd32cae47ac9
BLAKE2b-256 checksum
How to use checksums
178193899b7c5c849a4516191b2a7d32dfc59ab8259c10dd06606600c94d5720
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

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

Download URL p4n4_lib-0.4.2-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16b26337a87e3d782bfe5f23b6b0e5fcd9a8799822a5fde62f8f581bc3901c49
BLAKE2b-256 checksum
How to use checksums
ab19b6193fd33b0afd9271454721871d562d041ddaef7ead271ef0b5fe79fad4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Security for p4n4-lib 0.4.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for p4n4_lib-0.4.2.tar.gz

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 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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