Skip to main content

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


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.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

floowguard-0.1.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file floowguard-0.1.1.tar.gz.

File metadata

  • Download URL: floowguard-0.1.1.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

Hashes for floowguard-0.1.1.tar.gz
Algorithm Hash digest
SHA256 aee100ae383d2710fe0c3e3c7bf2bd55d9bf5bfb84255e10aad493037f68c9d5
MD5 ebad70f83441973b970da58f595a2202
BLAKE2b-256 47d1b5bb603be75e3562a02cb0a7e16841e59a6679d92d14acd122d3971b6732

See more details on using hashes here.

File details

Details for the file floowguard-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: floowguard-0.1.1-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

Hashes for floowguard-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eafa43f18d97ac01f15c580553f883df2bc415e00c5e21346f2cac47a6eb8e4f
MD5 18e61db9685de73773cd508918534f0b
BLAKE2b-256 257d952460fee7f3e825ae60b5f81fc76eb15616c1c504de3922af2d60754fcf

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