Barricator production-grade Python Server SDK (local evaluation, SSE sync, telemetry)
Project description
barricator-python-client
Production-grade Python Server SDK for Barricator. Standard library only (no third-party runtime deps), Python 3.9+.
Install
pip install barricator-client
Guarantees
- Zero-latency evaluation.
is_enabled(...)is a synchronous in-memory dict lookup — no I/O. - Local evaluation that mirrors the backend engine exactly (incl. MurmurHash3 bucketing — verified byte-identical with the Java SDK).
- Real-time sync over SSE on a daemon thread, with exponential backoff + jitter on disconnect and graceful fallback to cached state.
- Async telemetry flushed every 30s; never blocks the host application.
- Two tracks: synchronous
BarricatorClientand asyncio-nativeAsyncBarricatorClient.
Sync usage
from barricator import BarricatorClient, UserContext
with BarricatorClient("sdk-srv-...", base_url="https://app.barricator.io") as client:
user = UserContext("user-123", email="user@enterprise.com", custom={"plan": "pro"})
if client.is_enabled("premium-pricing", user):
...
theme = client.string_variation("homepage-theme", user, "control")
Async usage
from barricator import AsyncBarricatorClient, UserContext
async with await AsyncBarricatorClient.create("sdk-srv-...") as client:
user = UserContext("user-123", country="US")
enabled = client.is_enabled("beta-feature", user) # evaluation is sync (in-memory)
Test
python3 -m unittest discover -s tests -v
Layout
| Module | Responsibility |
|---|---|
barricator.client / barricator.aio |
Sync / async clients |
barricator.evaluation |
Local targeting engine |
barricator.store |
Thread-safe FlagStore + MetricsBuffer |
barricator.transport |
urllib bootstrap/flush + SSE parsing |
barricator.murmur |
MurmurHash3 (cross-SDK consistent) |
barricator.context |
UserContext |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file barricator_client-0.1.0.tar.gz.
File metadata
- Download URL: barricator_client-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d737b77924a7cadb6d7e89b45e9420b1ca0d0031993b466f8b19ae4cc95db1b4
|
|
| MD5 |
51d003b33c71213227cf3464b31629ea
|
|
| BLAKE2b-256 |
6587ab7d3ca4ed66bbaccb80ff73e75c7a259dc47cb6191b96e7e1ba508b0c4f
|
Provenance
The following attestation bundles were made for barricator_client-0.1.0.tar.gz:
Publisher:
release.yml on barricator/barricator-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
barricator_client-0.1.0.tar.gz -
Subject digest:
d737b77924a7cadb6d7e89b45e9420b1ca0d0031993b466f8b19ae4cc95db1b4 - Sigstore transparency entry: 1903389182
- Sigstore integration time:
-
Permalink:
barricator/barricator-python-client@8d3a69d3e1c1ea53d74684a3dbf9abe10ba63238 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/barricator
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d3a69d3e1c1ea53d74684a3dbf9abe10ba63238 -
Trigger Event:
push
-
Statement type:
File details
Details for the file barricator_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: barricator_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aff2013cdef126f8bd729a05d2fe526cc49f3f44c9b2d7d8a208b3fe416ad2cc
|
|
| MD5 |
5340ace5dbfaf5e761787c1a01d75d54
|
|
| BLAKE2b-256 |
a53bc789b04f529d1b13f816526c2c8e75635bb1c3035219e4dcdc35b5dd987d
|
Provenance
The following attestation bundles were made for barricator_client-0.1.0-py3-none-any.whl:
Publisher:
release.yml on barricator/barricator-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
barricator_client-0.1.0-py3-none-any.whl -
Subject digest:
aff2013cdef126f8bd729a05d2fe526cc49f3f44c9b2d7d8a208b3fe416ad2cc - Sigstore transparency entry: 1903389255
- Sigstore integration time:
-
Permalink:
barricator/barricator-python-client@8d3a69d3e1c1ea53d74684a3dbf9abe10ba63238 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/barricator
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d3a69d3e1c1ea53d74684a3dbf9abe10ba63238 -
Trigger Event:
push
-
Statement type: