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
client.increment('feature-name', 'user-id', 1)
# Decrement usage
client.decrement('feature-name', 'user-id', 1)
# 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.2.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 pylimiter-0.2.0.tar.gz.
File metadata
- Download URL: pylimiter-0.2.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3efb5c0a3ed52c4784c2dac21d26440900e0e52398b44f15364d73bfa24f0853
|
|
| MD5 |
3a9da7b803b72fca2613221ef7945be0
|
|
| BLAKE2b-256 |
1ae0b5732fd6ff16c596e3263f529f92a1494d1b03ff0b65eaaf24c552a9fe0e
|
File details
Details for the file pylimiter-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pylimiter-0.2.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77c3d5942aadb049c2e6da5006c927999f75e4e2e07ee004d481ba955b6bff71
|
|
| MD5 |
6e94c9c613c57741524cf7f7459b0e3c
|
|
| BLAKE2b-256 |
24013eda69d46f39ff9f4b8385d5d0cae545b61b5456f5683305180abc1de1c0
|