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, edge, dashboard)
p4n4_lib.layout Project layout: flat for single-layer projects, per-layer subdirectories for multi-layer
p4n4_lib.scaffold Fetch stack sources (local path or shallow clone) and copy into a project
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)

Stack repo URLs live in p4n4_lib/sources.yaml.

Install

pip install p4n4-lib
pip install -e path/to/core/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.2.0

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.2.0
File Size Uploaded
p4n4_lib-0.2.0.tar.gz 17.2 kB Details

Built distribution (wheel)

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

Total release size: 31.6 kB

Release files / p4n4_lib-0.2.0.tar.gz

Download URL p4n4_lib-0.2.0.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b2a72930eb4371be066db1eb312401a604bd38bcd1fd3bf28991f098c5ebb219
BLAKE2b-256 checksum
How to use checksums
af1ea3d5a261483717f6bbb9a7ea1bf713a1922fb11b16fa0c711f418c9bdea1
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 4, 2026.

Transparency log

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

Download URL p4n4_lib-0.2.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47d928d3b46ca96fdd0d60a4209ad81d8a21f72e9e8e4094db3c23f31d7a9b9c
BLAKE2b-256 checksum
How to use checksums
35aec3b8607d55c8029ed77ef291661f7b216124a60c3539cfcb6f6927536f6e
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 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

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