Skip to main content

fireweave (Python SDK)

Fireweave release-engineering SDK for Python — control points and target registration, the two v1 capabilities (spec/control-points.md "Scope of v1").

  • Zero runtime dependencies.
  • The SDK reads no environment variables — every option is an explicit argument to init_fireweave (spec/modes.md).
  • No vendor SDK, key, or hostname in your process. Applications hold a Fireweave project key and talk to fw-server; which backend fw-server forwards to is fw-server's concern.

Quick start (production path)

from fireweave import RegisterTargetOptions, init_fireweave, EvaluationContext

# mode is required and never inferred (spec/modes.md); api_key/api_url are
# explicit options — the SDK reads no environment variables.
client = init_fireweave(
    mode="remote",
    api_key="project-api-key_...",
    api_url="https://app-server.fireweave.ai",
)

# Once per login: the durable facts your targeting rules match on.
client.register_target(
    "user_42", RegisterTargetOptions(kind="user", properties={"plan": "pro"})
)

# Per request.
enabled = client.control_points.get_boolean_value(
    "new-checkout", False, EvaluationContext("user_42")
)

client.shutdown()

Quick start (offline, in-memory)

from fireweave import FireweaveClient, FireweaveRuntime, InMemoryAdapter

adapter = InMemoryAdapter({
    "new-checkout": {"enabled": True, "variant": "on", "value": True},
})
runtime = FireweaveRuntime(adapter)
runtime.initialize()
client = FireweaveClient(runtime)

assert client.control_points.get_boolean_value("new-checkout", False) is True
client.shutdown()

Quick start (local dev — no network, no credentials)

from fireweave import init_fireweave

client = init_fireweave(mode="local", local={"control_points": {"new-checkout": True}})
client.control_points.get_boolean_value("new-checkout", False)  # -> True
client.register_target("user_42")  # recorded in-process + traced; nothing sent
client.shutdown()

The nine methods

get_boolean_value / get_string_value / get_number_value / get_object_value, their *_details counterparts (return the whole Decision — reason, error_kind, flag_metadata, ... — instead of just the value), and the general-form evaluate. All nine live under client.control_points; client.flags is an identical, fully-supported alias (client.flags is client.control_points).

get_integer_value is a deprecated alias of get_number_value — spec fixes the method as number, not integer (Decision.value is jsonValue). It still works and delegates straight through; it logs one DeprecationWarning per process the first time it's called.

Module layout

Module Responsibility
domain/ Pure types + validation: errors.py, types.py, context.py, decision.py, target.py, validation.py. No I/O, no imports from application//infrastructure/.
application/runtime.py Lifecycle state machine, context layering, the evaluation pipeline. Evaluation never raises.
application/client.py FireweaveClient — control_points, register_target, invoke_capability (degrades; v1 has no supported capabilities).
application/mode.py init_fireweave — the single entry point and sanctioned composition root (the only file allowed to import concrete adapters).
application/ports.py The BackendAdapter boundary.
infrastructure/adapters/remote.py FireweaveRemoteAdapter — the production backend (POST /v1/flags/evaluate, POST /v1/targets/register).
infrastructure/adapters/local.py FireweaveLocalAdapter — the dev substrate: seeded boolean overrides, no network. register_target records in-process and traces the call.
infrastructure/adapters/memory.py Deterministic fixture-driven adapter for tests.
infrastructure/hosts.py SSRF allowlist (on by default; https required off-loopback).

Development

python -m venv .venv && .venv/bin/pip install -e '.[dev]'
# or: uv sync
.venv/bin/pytest    # unit tests

conformance/runner.py (the contracts/-fixture harness) still targets the pre-v1 surface and is not run by pytest today (tests/test_conformance.py skips it) — its rewrite for the v1 control-points surface is separate, cross-language follow-up work. conformance/surface/control-points.surface.json is the parity gate this package satisfies.

License

MIT.

Metadata

Release files for fireweave 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fireweave 2.3.0
File Size Uploaded Provenance Actions
fireweave-2.3.0.tar.gz 51.0 kB Without provenance Details for fireweave-2.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fireweave 2.3.0
File Interpreter ABI Platform Actions
fireweave-2.3.0-py3-none-any.whl Python 3 none any Details for fireweave-2.3.0-py3-none-any.whl

Total release size: 91.1 kB

Release files / fireweave-2.3.0.tar.gz

Download URL fireweave-2.3.0.tar.gz
Size 51.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6c202ef2de90e5f5c97251de68112ba51196b78705dc30fdf5afe4b22587f3c9
BLAKE2b-256 checksum
How to use checksums
80b95b3d4af8fbf11c394bdaa938799715085a6191f344e3d5e409f47c991b8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fireweave-2.3.0-py3-none-any.whl

Download URL fireweave-2.3.0-py3-none-any.whl
Size 40.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86183a18b9fd6ea9a70910d0d11a38ec49b1d0d0de682d10f20ee20f9bc4e2a4
BLAKE2b-256 checksum
How to use checksums
bd1bb13b11eda05cd725ab6d4fe4d1dc67a1b6618c1722a639901d40d9f77205
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for fireweave 2.3.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