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

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.0
File Actions
pyknf-0.7.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for pyknf-0.7.0-cp39-abi3-win_arm64.whl
pyknf-0.7.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for pyknf-0.7.0-cp39-abi3-win_amd64.whl
pyknf-0.7.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for pyknf-0.7.0-cp39-abi3-musllinux_1_2_x86_64.whl
pyknf-0.7.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for pyknf-0.7.0-cp39-abi3-musllinux_1_2_aarch64.whl
pyknf-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for pyknf-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyknf-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for pyknf-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
pyknf-0.7.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for pyknf-0.7.0-cp39-abi3-macosx_11_0_arm64.whl
pyknf-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for pyknf-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 6.2 MB

Release files / pyknf-0.7.0-cp39-abi3-win_arm64.whl

Download URL pyknf-0.7.0-cp39-abi3-win_arm64.whl
Size 659.5 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
4dfdd23bca2697ab41e8e2ae7a51e196f5add744404045ba612c3b2d8c35445b
BLAKE2b-256 checksum
How to use checksums
d0d53a0d9515859731e45c3ebd7ddc374e4d401764a2207b7f23069578119e37
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":"24.04","id":"noble","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.0-cp39-abi3-win_amd64.whl

Download URL pyknf-0.7.0-cp39-abi3-win_amd64.whl
Size 696.5 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
09fe043b16b42fa912a6d7a6d1a0fc01576799a89863e053ef3f37d6e9a478cd
BLAKE2b-256 checksum
How to use checksums
80087361285739608decc321e0a2488956be7896c5da1b3d26d57b69a369d608
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":"24.04","id":"noble","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.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL pyknf-0.7.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 985.3 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
d0a3185b0e0e25b8abdd68aea9d48f4f25415e023327570f4f680528f1f1899d
BLAKE2b-256 checksum
How to use checksums
437f3dc9b4ca84d831a8ca16790fee81a9868948bbd6a3fdd9b22222cee38815
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":"24.04","id":"noble","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.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL pyknf-0.7.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 903.8 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
fd41f798a1c63b3065b12ea4442d4b23cc4d5b7106d4e90558935071d0032654
BLAKE2b-256 checksum
How to use checksums
e5c0585df507e95f2696940752e5a39e85a4eddb26375f7de7566f90ddbb2a54
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":"24.04","id":"noble","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.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyknf-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 770.0 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
78ec0cce9dcdfe6c5cab23c81c4e9dbbecac3ce43f909c57cdc46b105eb68266
BLAKE2b-256 checksum
How to use checksums
c55169366598e2ec111e1af6c0a951f0c76649089efe2204aee86e6152033ac1
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":"24.04","id":"noble","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.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pyknf-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 725.0 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b35b0509d6312b38a1a223de3d51cf9f2ca014d2b56abc1d330f4eeb8f716ae8
BLAKE2b-256 checksum
How to use checksums
dc8394e00dfd2a4197599e8523e88ed1e8954a6e50cbc59924aed8f93bf541be
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":"24.04","id":"noble","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.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL pyknf-0.7.0-cp39-abi3-macosx_11_0_arm64.whl
Size 701.6 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
47e7ab5732b3d7368faa5aad3d66461128ed1acbfca690decf9ad1374c50ebb3
BLAKE2b-256 checksum
How to use checksums
5d89b8d336fca071f602ea038d66b72510632e4ab1641845bf07b41950dee21a
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":"24.04","id":"noble","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.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL pyknf-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 721.0 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
50b802b6e32c091ee9d0e64bf0775afec41c3c76f5708559c1e192ecf26cfaf1
BLAKE2b-256 checksum
How to use checksums
2df48beb601d519612a749721b9bac8dcb66107b6a9a93d0bd7edfc76d05e2fa
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":"24.04","id":"noble","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.0

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