Skip to main content

Barricador production-grade Python Server SDK (local evaluation, SSE sync, telemetry)

Project description

barricador-python-client

PyPI

Production-grade Python Server SDK for Barricador. Standard library only (no third-party runtime deps), Python 3.9+.

Install

pip install barricador-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 BarricadorClient and asyncio-native AsyncBarricadorClient.

Sync usage

from barricador import BarricadorClient, UserContext

with BarricadorClient("sdk-srv-...", base_url="https://app.barricador.com") 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 barricador import AsyncBarricadorClient, UserContext

async with await AsyncBarricadorClient.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
barricador.client / barricador.aio Sync / async clients
barricador.evaluation Local targeting engine
barricador.store Thread-safe FlagStore + MetricsBuffer
barricador.transport urllib bootstrap/flush + SSE parsing
barricador.murmur MurmurHash3 (cross-SDK consistent)
barricador.context UserContext

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

barricador_client-0.2.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

barricador_client-0.2.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file barricador_client-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for barricador_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a09aaa60c4ee13d07f15fd04368c71b5e05f1febdf75abfa2c17e376f71eb3c2
MD5 1759c3f3b546ce9d8e8c20d9a269901a
BLAKE2b-256 1b44851fc9849fd4ce52f80986e0994ff7fba775081d2bcb2ef3dc530eeded6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for barricador_client-0.2.0.tar.gz:

Publisher: release.yml on barricador/barricador-python-client

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

File details

Details for the file barricador_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for barricador_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5bcfb6f71cdad6d1afdf2111b82aa40cd59c9ec6d901d8ad0870915d4c7e829
MD5 551574c909f33b6fb91e1dbca4e731a7
BLAKE2b-256 5c125b43da6ae1cd2529b6ce7384ad3e214bc34d6dc068a7ac2f4aed72506ee8

See more details on using hashes here.

Provenance

The following attestation bundles were made for barricador_client-0.2.0-py3-none-any.whl:

Publisher: release.yml on barricador/barricador-python-client

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