Skip to main content

pyknf

Merge layered JSON or TOML config files into a dict, using the same Rust engine as the knf CLI.

pip install pyknf  # the `knf` module and the `knf` executable
from knf import accumulate, filter_paths, load

config = load(["base.toml", "prod.toml"])
config = load(["base.toml", "prod.toml"], interpolate=True, shallow="db.*")
config = load(["foo.toml", "bar.toml"], interpolate=True, context="config.toml")
config = load(["config.toml"], interpolate=True, merge_key="extends")

files = accumulate("services/api/prod.toml", base_dir=project_root)
files = filter_paths(files, "{defaults,prod}.toml", filename_only=True)
config = load(files)
  • load merges left to right: objects recurse; arrays, scalars and None replace. All files must share one format. An empty list returns {}.
  • interpolate=True resolves ${key.path} and ${env:NAME} against the final document. A whole-string reference merges as the value it names, so an object referent merges with an object from another file.
  • context="config.toml" supplies one same-format filepath without merging it; requires interpolate=True. Complete paths prefer output, then context, including context dependencies. Only referenced context values resolve.
  • shallow="PATTERN" replaces matching key paths wholesale ("*", "db", "db.*").
  • merge_key="extends" uses the object referenced by extends = "${foo}" as defaults for its parent. Local fields win; the directive is removed. Requires interpolate=True and honors shallow at destination paths.
  • accumulate collects same-format files along a relative target path, with the target last. filter_paths filters a list by glob without I/O.
  • Errors: knf.ParseError and knf.InterpolationError (both ValueErrors), ValueError for bad arguments, and OSError subclasses for I/O failures.
  • TOML datetimes become datetime, date or time objects.

See the project README for details.

Metadata

Release files for pyknf 0.7.1

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

Built distributions (wheels)

Table of built distributions (wheels) for pyknf 0.7.1
File Actions
pyknf-0.7.1-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for pyknf-0.7.1-cp311-abi3-win_arm64.whl
pyknf-0.7.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for pyknf-0.7.1-cp311-abi3-win_amd64.whl
pyknf-0.7.1-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for pyknf-0.7.1-cp311-abi3-musllinux_1_2_x86_64.whl
pyknf-0.7.1-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for pyknf-0.7.1-cp311-abi3-musllinux_1_2_aarch64.whl
pyknf-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for pyknf-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyknf-0.7.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for pyknf-0.7.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
pyknf-0.7.1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for pyknf-0.7.1-cp311-abi3-macosx_11_0_arm64.whl
pyknf-0.7.1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for pyknf-0.7.1-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 6.2 MB

Release files / pyknf-0.7.1-cp311-abi3-win_arm64.whl

Download URL pyknf-0.7.1-cp311-abi3-win_arm64.whl
Size 669.3 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
e78c9e4afbe0702d443aff595518eeef7ea0de5f01539a515d40c238f16a9b2f
BLAKE2b-256 checksum
How to use checksums
ed9104609095e7ee392e9274657732c866aaf757c58d873fe2ec711d0d65348a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyknf-0.7.1-cp311-abi3-win_amd64.whl

Download URL pyknf-0.7.1-cp311-abi3-win_amd64.whl
Size 705.4 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3ddfc7b8850c81301f7d2da1c3245a2e73a4cac4910a658fe930ed8e4094aa89
BLAKE2b-256 checksum
How to use checksums
0278b3009d2a1b808bacc0b3a5c49533d2cfbe40f52eb3d60ce5b975b0875328
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyknf-0.7.1-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL pyknf-0.7.1-cp311-abi3-musllinux_1_2_x86_64.whl
Size 983.6 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
122071f8bfa116d568251ddb7f8fd125a8b87ce9296c45adea14dc6739e730f2
BLAKE2b-256 checksum
How to use checksums
a5781d3ed7fa13cfa04526e8fa2438fb131c7a672a345bd2d300b58e72c3bde6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyknf-0.7.1-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL pyknf-0.7.1-cp311-abi3-musllinux_1_2_aarch64.whl
Size 906.4 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
a441e95b4a45be5a1fac5f215f1f4745e829e934d3481cdd6eee969ccfdc4d46
BLAKE2b-256 checksum
How to use checksums
afdd01973e783aa12c664b704c9518336839086f79b430f2e3c3d3f50d850283
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyknf-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyknf-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 768.7 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c5a5ebe73d964c6a737896e99b4eccdcb9b522f42157a41ca1c30266136549ec
BLAKE2b-256 checksum
How to use checksums
37d414aabfca68382e2553de97f488907bdd9fb1c372462aed8e94977810c9af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyknf-0.7.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pyknf-0.7.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 729.5 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
bb0b6a5413b3c55f1bf520ec863fb6b7dd8465f681d06243f9600c33436d8cf8
BLAKE2b-256 checksum
How to use checksums
6eb88ba3dc679ccf4749a73ca50a7e8e4a05c9a7d517e773d7a7ea380265ca0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyknf-0.7.1-cp311-abi3-macosx_11_0_arm64.whl

Download URL pyknf-0.7.1-cp311-abi3-macosx_11_0_arm64.whl
Size 706.4 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8ecb547127cc700f609507a4d37eaad37883eba2b355c0f03cfb97a707c70cb6
BLAKE2b-256 checksum
How to use checksums
6d773d37645abe9a462267fd81e716434305c1c81307312e849afb2e9df8f458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyknf-0.7.1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL pyknf-0.7.1-cp311-abi3-macosx_10_12_x86_64.whl
Size 727.1 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
1baa5b59bd194275969833c9f2d0baace62b01a94060741daaf12976f37898f2
BLAKE2b-256 checksum
How to use checksums
7a53e820308c5d3c1e0b80f87a96d3597c7d482a92ea069f025337c5977c5959
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pyknf 0.7.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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