Skip to main content

ToggleMesh Python SDK

Project description

ToggleMesh Python SDK (Local Evaluation)

A lightweight, robust Python SDK for evaluating feature flags with ToggleMesh.

This SDK uses Local Evaluation. It connects to the ToggleMesh control plane once to fetch all rules, establishes an SSE (Server-Sent Events) connection to listen for updates, and evaluates all flags locally in-memory without making network requests. This ensures ultra-fast responses (sub-millisecond) suitable for high-throughput backend services.

Installation

pip install togglemesh

Usage

import time
from togglemesh import ToggleMeshClient, ToggleMeshOptions

client = ToggleMeshClient(ToggleMeshOptions(
    base_url="http://localhost:5000",
    client_key="YOUR_API_KEY"
))

# 1. Identify the user
client.identify("user-123", {"tenant": "acme_corp", "plan": "enterprise"})

# 2. Check a flag locally (Zero network latency!)
if client.is_enabled("new-feature", default_value=False):
    print("Feature is ON")
else:
    print("Feature is OFF")

# 3. Stop background threads when the app shuts down
client.stop()

Supported Features

  • Percentage Rollouts (Murmur3 / FNV-1a hashing)
  • Operator matching (Strings, Numbers, Dates, SemVer, Regex)
  • Real-time SSE updates
  • Contextual Rollouts

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

togglemesh-0.2.4.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

togglemesh-0.2.4-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file togglemesh-0.2.4.tar.gz.

File metadata

  • Download URL: togglemesh-0.2.4.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.15.0b1

File hashes

Hashes for togglemesh-0.2.4.tar.gz
Algorithm Hash digest
SHA256 0efe75e7060ef10049f9d9867a0b1a7aee167af51eabce6336b70e0fa6bc8d61
MD5 cc9209e9d0b3522e38e53e6e203578f5
BLAKE2b-256 9435d7b781fb1184fa4b9eda7ca085f82ff74804feab044aade07c29b155a384

See more details on using hashes here.

File details

Details for the file togglemesh-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: togglemesh-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.15.0b1

File hashes

Hashes for togglemesh-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c2f177b8521c585b62ae153853a4e806c406bebad611283a453b74a2629b8598
MD5 40b7efd8a378e959572392cc88a5191c
BLAKE2b-256 27c149edcfcf6f3405e1fcc11543e06c917a79c05745c8499d670ea80593be08

See more details on using hashes here.

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