Python client SDK for the Floowguard policy engine
Project description
Floowguard Python SDK
A minimal Python client for the Floowguard policy engine, mirroring the Node.js SDK interface.
Installation
This package depends on requests:
pip install requests
(If you package this as a library, include requests in your own dependency metadata.)
Usage
import os
from flowguard import FlowGuardApiClient
application_id = os.environ["FLOOWGUARD_APPLICATION_ID"]
client = FlowGuardApiClient(application_id)
identifier = "ACCOUNT_ID_OR_USER_ID"
# Check if this action should be allowed
allowed = client.has_access(
policy_name="POST_CREATION_LIMIT_EXAMPLE",
value=identifier,
)
if not allowed:
raise RuntimeError("You reached your limit for post creation for today. Try tomorrow.")
# Record the successful action and get the latest count
result = client.increment_and_get_policy_count(
policy_name="POST_CREATION_LIMIT_EXAMPLE",
value=identifier,
)
print("Current decision:", result.get("response"))
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
floowguard-0.1.0.tar.gz
(3.3 kB
view details)
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 floowguard-0.1.0.tar.gz.
File metadata
- Download URL: floowguard-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04bb677733dbf691984d1809b16f28aa0341f48c2d905648530e7a7cc336d178
|
|
| MD5 |
c5c3d026ac2aafb4b89d2f6c4d5c5eb1
|
|
| BLAKE2b-256 |
71f3f2a66af236c10bfd02879fea76d6a3c7eb4c737349454fbc25223e44f6a9
|
File details
Details for the file floowguard-0.1.0-py3-none-any.whl.
File metadata
- Download URL: floowguard-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff3d210e9da968bb11b897ebcea865dedab57060406b1ab8ca863c3bf6cbfdd4
|
|
| MD5 |
f19685ddbe35cbce4bb2baebaa43feb3
|
|
| BLAKE2b-256 |
3407da14806f6f45e40bca48a8452fae06ab2827fde2c009c71ab6f65eef7d4b
|