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

Total release size: 6.1 MB

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

Download URL pyknf-0.6.0-cp39-abi3-win_arm64.whl
Size 657.8 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
fcb7289b1b9248ca9d2765168acbf6371aaf6fa712328c7d707110d2d43be258
BLAKE2b-256 checksum
How to use checksums
fd9194f6b4b1d7da1b03bf038b084c1c747a3c367de91885241a7117ea303df2
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.6.0-cp39-abi3-win_amd64.whl

Download URL pyknf-0.6.0-cp39-abi3-win_amd64.whl
Size 693.7 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c95f084850bbccfa4f9c33eb8c5cc85c2a974f21e484fcb0dec56da62446d19b
BLAKE2b-256 checksum
How to use checksums
5f4992c07fa6c0dd0f30c4af196aa4292a570b37e72669eaa1d9eb1236342990
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.6.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL pyknf-0.6.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 984.1 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
52a4f7f966194a5d17abc610723be68c5ddc6af05b530c304055f181892470fe
BLAKE2b-256 checksum
How to use checksums
7ed7b9d16cfa0cf4eb847779b559095c8d09a2e0311b24977ef6b4b85add11ac
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.6.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL pyknf-0.6.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 901.4 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
831c7e688fc7bb3795c622cca020b9ec033fd786f5105f172ac9a85bae3ee283
BLAKE2b-256 checksum
How to use checksums
172b4128a33022530bc8e7ebc2d4d96a66fcad91f6f079e81a65badd501cfc78
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.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyknf-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 769.0 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5caa79c38baeea97ffec9a05077c820f37c3818cc32f418802c8e5ddeb8196ad
BLAKE2b-256 checksum
How to use checksums
e86b086d30674f4958a743d42a43890ac7912c3c630fe704aa46c17f907d2441
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.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pyknf-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 722.7 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
6c9b4e8028fd8f3c77985c5079fed923c81f40c7c03f4f70c6e8ed9135dba994
BLAKE2b-256 checksum
How to use checksums
be1392d0f8828024bdeed17cd04a43b0335dcf35f053e3a458c63a6b525c9d07
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.6.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL pyknf-0.6.0-cp39-abi3-macosx_11_0_arm64.whl
Size 699.6 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e088b193f684010f7371594436b85ae77e1ebb07ee16d0bd0172f7fb2847491f
BLAKE2b-256 checksum
How to use checksums
4eb2372439599eb044ae1423be68b3ad9d3d3da1bd27933d41de8dbe7f0bb5e8
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.6.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL pyknf-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 720.9 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
824561d268d8bbf1fdc022de89146b9aeecdb85176cef3cef24301864f8247b4
BLAKE2b-256 checksum
How to use checksums
1a54b483080e2327c97538703c6faca78f6a5ff88eb8292d592b2217b832c005
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.6.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