Skip to main content

Limiter Python SDK

Project description

Limiter Python SDK

Installation

pip install pylimiter

Quick Usage

Default Backend

Initialize SDK with the managed storage backend

from pylimiter import limiter

opts = {
  backend: 'Default',
  api_token: 'api-token',
};
client = limiter.Client('project-id', opts);

Available Methods

# Bind user to a plan
client.bind('plan-name', 'user-id')

# Check if a feature is within limit
if client.feature('feature-name', 'user-id'):
  print('Pass')

# Increment usage by 1.
client.increment('feature-name', 'user-id')

# Decrement usage by 1.
client.decrement('feature-name', 'user-id')

# Set usage to some value.
client.set('feature-name', 'user-id', 5)

# Get feature matrix for the project
feature_matrix = client.feature_matrix()

# Get user's usage data
usage = client.usage('user-id')

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

pylimiter-0.1.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

pylimiter-0.1.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file pylimiter-0.1.2.tar.gz.

File metadata

  • Download URL: pylimiter-0.1.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.10

File hashes

Hashes for pylimiter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bdab97b82d2aa9e322d6767d0874444a2643569f5684380ddb94ea047ae63270
MD5 eeb686cc05679d50b623e69434cde13b
BLAKE2b-256 af699170046c24e596cd98dbed0913f1f0bd7c0c59b7803aa6f0c5d1345d934b

See more details on using hashes here.

File details

Details for the file pylimiter-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pylimiter-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.10

File hashes

Hashes for pylimiter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7b06b89a23fbe06f46007d10d4653bb9b9d6b3ef443bf8462409006aaaceb67
MD5 559d61d415bacb9f08ec881c0d021681
BLAKE2b-256 25eaf7c088b6bfb4fdf5cdfa20317874199b55f29c007c9ad0539f2fcc987113

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