Skip to main content

Python bindings for fnox

Project description

fnox-py

fnox-py is a thin Python wrapper around the fnox binary.

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

Installation

pip

pip install fnox-py

uv

uv add fnox-py

If you want the CLI available outside a project environment, you can also use a tool install:

uv tool 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/

To bump the bundled version, update FNOX_VERSION.txt and commit the change.

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.0.2.tar.gz (6.4 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.0.2-py3-none-win_arm64.whl (13.8 MB view details)

Uploaded Python 3Windows ARM64

fnox_py-1.0.2-py3-none-win_amd64.whl (14.5 MB view details)

Uploaded Python 3Windows x86-64

fnox_py-1.0.2-py3-none-manylinux_2_17_x86_64.whl (21.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

fnox_py-1.0.2-py3-none-manylinux_2_17_aarch64.whl (20.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

fnox_py-1.0.2-py3-none-macosx_11_0_arm64.whl (16.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

fnox_py-1.0.2-py3-none-macosx_10_12_x86_64.whl (17.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for fnox_py-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2c751c2950b56854e7f615d2fb4182fa846bdbb8bec110ded24153c684a96d3d
MD5 6a3f6087e1b9bdeefb1f719373d561a4
BLAKE2b-256 05a6b3bad445dacbf67695bdb4b8cf2eba915efbb959d48a1581d2733adb04c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.0.2.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.0.2-py3-none-win_arm64.whl.

File metadata

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

File hashes

Hashes for fnox_py-1.0.2-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 fb867db45d8990a86f6d3bc3cd90c42ab531994d56675028450a574c94bbb026
MD5 e66356ee2ff8e54744aa2e2c4e026e8b
BLAKE2b-256 6225dd2dd019d1577420fe633ebfd702d874ac00b654e5a7b6ac114f132e4b02

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.0.2-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.0.2-py3-none-win_amd64.whl.

File metadata

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

File hashes

Hashes for fnox_py-1.0.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 865472094cfe2921460aa73884fedc3840ab44aa5d9bcf19059790187098d0f5
MD5 3a5e16d9ab910c83d68dd8b889ce8d27
BLAKE2b-256 1b7638cda2201e347bc0d822931e2df8c23e76cae458a84283e0f21925f71092

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.0.2-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.0.2-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fnox_py-1.0.2-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2c0441f55efb3215c53d39255e534f3a71df3631db3ac2a5f92eca3803ad822c
MD5 d24e66faae7b5c03eab151c68b997b5d
BLAKE2b-256 d561c93849f91ac358fc3928c2c5cefb18f3e78c77140fad877f10df6f482112

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.0.2-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.0.2-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for fnox_py-1.0.2-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 d3df8008f89e8aa9cda796b5193c72300408e2cf4b675c2c7380fa2300bfcc11
MD5 f776b56441ada39c43cbdf5688f702c9
BLAKE2b-256 48431ac9e2b8d63bc34d4b5d228fbba9cd285396a693860571cec7a731b5dc17

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.0.2-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.0.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fnox_py-1.0.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6e2dcd98c905cf44904d6fcc3caa12cdb87a334ff3473614122d2a639eaad41
MD5 1a3f633f2a72dea61bb86f0e5eb5e061
BLAKE2b-256 86d384617ece7d30dc977597f342b9033459a6fba99798779a9286b018946a8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.0.2-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.0.2-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fnox_py-1.0.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 febc4f35ad744f4e957f9482eea5ba5862e43245ac8e1ca1080b778555eaf9fa
MD5 66023ce5d8c3ab043f61ed29114a29eb
BLAKE2b-256 104bcb752a3c4b4cd75dad2ad8e69f02e7e93073b931e800dd5615f8bd89ec06

See more details on using hashes here.

Provenance

The following attestation bundles were made for fnox_py-1.0.2-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