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.4.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.

pylimiter-0.1.4-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pylimiter-0.1.4.tar.gz
  • Upload date:
  • Size: 3.3 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.4.tar.gz
Algorithm Hash digest
SHA256 59d4b7272bb0120ab7e1e2f1591d6af44eddea9a230dc0f09dc6ecb890e4c8f2
MD5 c4196fc040b80841faa7b4625222e13f
BLAKE2b-256 ec90e53952c4dd6bbbedbf8abe2b2950da8ab71267f7127c185e6e9a1ca7452a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylimiter-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 03e1f64566003f6309e5883d80eaab8f233e81cf06bdcbaa22fb868ca9d14e80
MD5 99848bff8400c673c1e01f9dbcaceebf
BLAKE2b-256 1eb2f205e9204045cb7d61997db5f49e2db44dde30f80691f53b698c37f0aa70

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