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.3.tar.gz
(2.6 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 pylimiter-0.1.3.tar.gz.
File metadata
- Download URL: pylimiter-0.1.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28700e65c657928f37a3162765fb59ebf3ffbab150b39db1bdc98a27f621a55e
|
|
| MD5 |
9870ecb30be8d151b175feca83d97ff8
|
|
| BLAKE2b-256 |
facd643bda4716ecf0160da5ee17889cbb51c588e1bf9272f5c2af5a6459d011
|
File details
Details for the file pylimiter-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pylimiter-0.1.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67185cbb67994f7248d39b2f828686f78ece5d8ff935f61a45bb9c4d6b21b184
|
|
| MD5 |
9f356e0e7c8aecfe66818cf4594c86d0
|
|
| BLAKE2b-256 |
943239323eaa2d56b1bcf75586e9dadfed4befdda9093e9a20c69aeb282b797c
|