Skip to main content

Python wrapper for fnox

Project description

fnox-py

fnox-py is a thin Python wrapper around the fnox secrets management tool.

It does not reimplement fnox behavior in Python. Instead, it:

  • locates a real fnox binary
  • builds argv for common commands
  • runs the binary
  • returns parsed results or typed errors

Python requirement: >=3.12

[!NOTE] Official fnox project links:

Installation

uv

uv tool install fnox-py

pip

pip install fnox-py

Bundled binary vs source install

Platform wheels are intended to bundle the fnox binary.

If you install from source instead of a platform wheel, fnox-py requires a real fnox executable to be available via:

  • PATH, or
  • FNOX_PY_BINARY=/absolute/path/to/fnox

Examples:

pip install --no-binary fnox-py fnox-py
FNOX_PY_BINARY=/usr/local/bin/fnox python -c "import fnox_py; print(fnox_py.version())"

Binary Resolution

At runtime, fnox-py resolves the fnox binary in this order:

  1. FNOX_PY_BINARY
  2. bundled/installed locations in the current environment
  3. bundled/installed fallback locations associated with the base or target install
  4. user scheme script location
  5. PATH

If FNOX_PY_BINARY is set but points to a missing file, fnox-py raises FnoxNotFoundError.

Python API

from fnox_py import (
    config_files,
    export_json,
    get,
    lease_create,
    profiles,
    providers,
    schema,
    version,
)

value = get("MY_SECRET")
all_values = export_json()
schema_doc = schema()
profile_names = profiles()
provider_names = providers()
config_paths = config_files()
lease = lease_create("vault", duration="1h", label="local-dev")
fnox_version = version()

Common examples

Get a single value:

from fnox_py import get

token = get("API_TOKEN")

Get a value from a specific profile:

from fnox_py import get

token = get("API_TOKEN", profile="prod")

Decode base64 output:

from fnox_py import get

decoded = get("TLS_CERT", base64_decode=True)

Export all secrets as JSON:

from fnox_py import export_json

data = export_json(profile="dev")

Inspect schema, profiles, providers, and config files:

from fnox_py import config_files, profiles, providers, schema

print(schema())
print(profiles())
print(providers())
print(config_files())

Create a lease:

from fnox_py import lease_create

lease = lease_create("vault", duration="30m", label="ci-job")

Get the underlying fnox version:

from fnox_py import version

print(version())

CLI

The package installs the fnox-py console script.

Built-in subcommands

Locate the resolved binary:

fnox-py which

Show the wrapper version and attempt to print the underlying fnox version:

fnox-py version

Print basic environment diagnostics:

fnox-py doctor

Passthrough behavior

Any arguments other than which, version, and doctor are passed directly through to fnox.

For example:

fnox-py get MY_SECRET
fnox-py profiles
fnox-py export --format json

With no arguments, fnox-py runs fnox with no extra argv.

Public API

fnox-py currently exports:

  • config_files
  • export_json
  • get
  • lease_create
  • profiles
  • providers
  • schema
  • version
  • find_fnox_bin
  • run
  • FnoxResult
  • FnoxCommandError
  • FnoxError
  • FnoxNotFoundError
  • FnoxTimeoutError

Errors

Library calls raise typed exceptions:

  • FnoxNotFoundError when the binary cannot be found
  • FnoxCommandError when fnox exits non-zero
  • FnoxTimeoutError on subprocess timeout
  • FnoxError as the base exception type

Development

This project uses uv, pytest, ruff, and mypy.

Install dependencies:

uv sync

Run tests:

uv run pytest -v

Run a single test:

uv run pytest tests/test_api.py::test_get -q

Lint:

uv run ruff check src tests scripts

Type-check:

uv run mypy src

Build distributions:

uv build

Release / Platform Wheel Build

scripts/build_platform_wheel.py builds platform-specific wheels by:

  1. building a pure Python wheel
  2. downloading upstream fnox release binaries
  3. injecting the binary into the wheel
  4. rewriting wheel metadata
  5. building an sdist

The upstream fnox version to bundle is read from FNOX_VERSION.txt at the repo root by default. To override it, pass --fnox-version:

uv run python scripts/build_platform_wheel.py --fnox-version 1.0.0 --output dist/

Expected upstream archive and extracted binary SHA256 values are pinned in FNOX_HASHES.json and verified during release builds.

To bump the bundled version, update FNOX_VERSION.txt, refresh FNOX_HASHES.json, and commit both changes.

Notes

  • fnox-py is intentionally small and wrapper-focused.
  • For behavior, flags, and command semantics, prefer the upstream fnox documentation.
  • If you need lower-level control, use run() directly and inspect FnoxResult.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fnox_py-1.24.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fnox_py-1.24.1-py3-none-win_arm64.whl (14.7 MB view details)

Uploaded Python 3Windows ARM64

fnox_py-1.24.1-py3-none-win_amd64.whl (15.6 MB view details)

Uploaded Python 3Windows x86-64

fnox_py-1.24.1-py3-none-manylinux_2_17_x86_64.whl (22.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

fnox_py-1.24.1-py3-none-manylinux_2_17_aarch64.whl (21.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

fnox_py-1.24.1-py3-none-macosx_11_0_arm64.whl (17.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

fnox_py-1.24.1-py3-none-macosx_10_12_x86_64.whl (18.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file fnox_py-1.24.1.tar.gz.

File metadata

  • Download URL: fnox_py-1.24.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fnox_py-1.24.1.tar.gz
Algorithm Hash digest
SHA256 518e7ea7e156bd19cd3f0a129c80f244a9d97424effa72cfd711b3b01d5d554b
MD5 e6e918fd88e6acffe18635184cc59125
BLAKE2b-256 79ba5cde51fa291ccd0c9f4a50638583aff8b59ae0a75b8d9393fdb59a62d228

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.24.1.tar.gz:

Publisher: release.yml on fullerzz/fnox-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fnox_py-1.24.1-py3-none-win_arm64.whl.

File metadata

  • Download URL: fnox_py-1.24.1-py3-none-win_arm64.whl
  • Upload date:
  • Size: 14.7 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fnox_py-1.24.1-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 5e6543ec1c81266f2992fd765ed3b0f0ebbf7c11426ba4ab20b6579fb602e715
MD5 70c0531a4b6f874b61b941e2251ac700
BLAKE2b-256 13fa68aca4da333d0171597537e1bd7608976824dd703936ce2fa8c5f1e5489b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.24.1-py3-none-win_arm64.whl:

Publisher: release.yml on fullerzz/fnox-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fnox_py-1.24.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: fnox_py-1.24.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 15.6 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fnox_py-1.24.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c776f2b19e3874bd12fead151db195d1c8b463d87a0eb74379c45fdc66979aec
MD5 97a97771f770b84745b2ab64b356f44b
BLAKE2b-256 94d542f62342f8664bbcf0584bfa009cefc739afc1e838cccf745b39e4f210b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.24.1-py3-none-win_amd64.whl:

Publisher: release.yml on fullerzz/fnox-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fnox_py-1.24.1-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fnox_py-1.24.1-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 00c4d6ed3928aa67bc9589eb2ddde2a85f70e4ff68864ce601b04807e2f8b4a9
MD5 a31de83211bd40a8a64f0d157a6d095e
BLAKE2b-256 4b7c360a6994718f986f5d7795afc9f409254def62801680c6ed35b04cb81a9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.24.1-py3-none-manylinux_2_17_x86_64.whl:

Publisher: release.yml on fullerzz/fnox-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fnox_py-1.24.1-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for fnox_py-1.24.1-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 23150de513106dd738df35599dc560e3f87cea0273bbee5cf1b40ad77bc3a0fd
MD5 2338610e5da7e4329c6221951bf45551
BLAKE2b-256 566505bbc6d9715ff914e3f800096fc25e301a679cadd49459fd5920fe6beb59

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.24.1-py3-none-manylinux_2_17_aarch64.whl:

Publisher: release.yml on fullerzz/fnox-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fnox_py-1.24.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fnox_py-1.24.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f85c4a766c16da724b2c177d8632b498875d523bbffeb47f7326a1dff6b592c
MD5 04899b3bc7be3024ec01cddd0f0aa3b6
BLAKE2b-256 60ea2e03b17b80db52270e24347488c78c0ad4e646ac8b63f5280f9fbb26027b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.24.1-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on fullerzz/fnox-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fnox_py-1.24.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fnox_py-1.24.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f4d38bfed52ffe4a50faaacf302e138c4cfec04720d5f1df42174685da8af66d
MD5 09c8a308beb6b68c482b74fbbbaa7fe9
BLAKE2b-256 ac4f1440bb72add50bed590f856c81de272186d4f0525fe317c436124b253eba

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.24.1-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on fullerzz/fnox-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page