Skip to main content

Liteguard Python SDK

Python SDK PyPI

Installation

pip install liteguard

Requires Python 3.9+.

Quick Start

from liteguard import ClientOptions, LiteguardClient

client = LiteguardClient(
    "pckid-...",
    ClientOptions(environment="production"),
)
client.start()

scope = client.create_scope({"user_id": "user-123", "plan": "pro"})

if scope.is_open("payments.checkout"):
    ...

client.shutdown()

Primary API

  • LiteguardClient(project_client_key_id, options) creates a client.
  • client.start() fetches the initial bundle and starts refresh and flush workers.
  • client.create_scope(properties=None) creates an immutable request scope.
  • scope.is_open(name, options=None) evaluates a guard locally.
  • scope.execute_if_open(name, fn, options=None) measures guarded execution.
  • scope.bind_protected_context(protected_context) returns a derived protected scope.
  • client.flush_signals() flushes buffered telemetry.
  • client.shutdown() flushes and stops background workers.

Notes

  • Guard evaluation is fully local after the initial fetch.
  • Scopes are immutable and request-scoped.
  • contextvars keep overlapping async request scopes isolated.
  • Unadopted guards default open and emit no signals.

Development

make test-python

License

Apache 2.0 — see LICENSE.

Metadata

Release files for liteguard 0.2.20260314

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

Source distribution (sdist)

Source distribution for liteguard 0.2.20260314
File Size Uploaded Provenance Actions
liteguard-0.2.20260314.tar.gz 19.6 kB Without provenance Details for liteguard-0.2.20260314.tar.gz

Built distribution (wheel)

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

Total release size: 33.3 kB

Release files / liteguard-0.2.20260314.tar.gz

Download URL liteguard-0.2.20260314.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
59af6c3a68f0fedc249a64e1135a852ef969e0eeee13d1efc328ca0d149d4aeb
BLAKE2b-256 checksum
How to use checksums
0ad2c519c691126cac21333c87a78dc5628ac930227c7f415d085c91e3c3af97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / liteguard-0.2.20260314-py3-none-any.whl

Download URL liteguard-0.2.20260314-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9eabc771e9f0668491cfe80324070e64cf3aeaf3add2bfe99db028f17f22ce94
BLAKE2b-256 checksum
How to use checksums
681925001a663085826047b8a942cc778055af32ad76064daaa35260bf67e172
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for liteguard 0.2.20260314

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