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

Example:

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

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-0.1.0.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-0.1.0-py3-none-win_arm64.whl (10.5 MB view details)

Uploaded Python 3Windows ARM64

fnox_py-0.1.0-py3-none-win_amd64.whl (11.1 MB view details)

Uploaded Python 3Windows x86-64

fnox_py-0.1.0-py3-none-manylinux_2_17_x86_64.whl (16.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

fnox_py-0.1.0-py3-none-manylinux_2_17_aarch64.whl (16.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

fnox_py-0.1.0-py3-none-macosx_11_0_arm64.whl (12.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

fnox_py-0.1.0-py3-none-macosx_10_12_x86_64.whl (13.3 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: fnox_py-0.1.0.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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 90269fdb980a5d6a18b81799725736da2f30bd4da40cf52ac16a596c82c0b261
MD5 f5a8443dbbd7724073a57dcfe700a533
BLAKE2b-256 622ef4808569da8dc8cfacfd4e2360057848885c9f4d945f67fb38f8f4224e5e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: fnox_py-0.1.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 10.5 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-0.1.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 f2122cacc8a6d32d9f233d6f8f2923867171940b2d9b9c0ee26b0b542b61d28e
MD5 5a165d794eacc3877a958a3ac4a6c384
BLAKE2b-256 d144a42c3aafea7442d06ec53fc4af76108f74390ca66105ee3c0645cc493e6a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: fnox_py-0.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 11.1 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-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c6e53922bfbadc9f85b4ae35aefd02ba8cba3bb4ae9e4322861f522f9862d487
MD5 4152527d5903a81c23dc8df55b978230
BLAKE2b-256 453418f616f1d81170b2a5879f1ddbf23f3610f3ed8d9f2c9620286666b3d62c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for fnox_py-0.1.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 adb34166ae07adf5991350d163fc45ecd3a932de6c259ed17ccc5c05bee3bcb6
MD5 d5bb98cfea2b2a57b255b26da9dec7a9
BLAKE2b-256 fa0098ac62575435b031fe6adb5a0f5e976c368320c8d2f0d5c0f12c4f6c8d52

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for fnox_py-0.1.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 f41bb807e77ebaabfade41bfc41cc5af56c13f9d3a8e717bb00ad1b0df381cfe
MD5 ffb8d78642563d887093bc4d055ef8b6
BLAKE2b-256 6ebd062292fc147a8428f5f6f938dc86639380e4c36992b728f5a174a63ab363

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for fnox_py-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2c9fa634fb3cd43d61d0e37d942efce6a98a57068447d90c7d474f459bab467a
MD5 14ec542c61e50545720ade75750d4e9a
BLAKE2b-256 855c33d013e3743fa1f78765be1a9215ba06a92385ff428a44e7987c526fdf7b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for fnox_py-0.1.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5f78fe7516a9bbabd879200e3951f00f737184c7301ae938d844288c97128b1a
MD5 eda3949f36e8a1119419b3e832d1f424
BLAKE2b-256 72b323ea04ad931a4914cc058da48e9988cf01e8f15f93016e9ad27926f31932

See more details on using hashes here.

Provenance

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