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/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.3.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.3.0
File Size Uploaded
p4n4_lib-0.3.0.tar.gz 71.6 kB Details

Built distribution (wheel)

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

Total release size: 101.8 kB

Release files / p4n4_lib-0.3.0.tar.gz

Download URL p4n4_lib-0.3.0.tar.gz
Size 71.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7a43aeaca07a47228550b8cbcfeac1b3ffe59998534b047ef97b853f9027e4d1
BLAKE2b-256 checksum
How to use checksums
8644e03f6530d0bc9b9851b87a8d51d8e71ec7c08570bcf380e847afc8377ae4
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 14, 2026.

Transparency log

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

Download URL p4n4_lib-0.3.0-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
547ca1f3af693cbd330bebc67bae67621faff1a694ba548a3cfe922456d1e436
BLAKE2b-256 checksum
How to use checksums
e7d151995fa9e8e06a08c7fd67f6dd2d4148f4c9f71501a043de8553f474977a
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 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.1

2 release files

0.4.0

2 release files

This release

0.3.0 This release

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