Varsnap
Project description
Varsnap Python
Installation
Install from PyPI - pip install varsnap
Requirements
The client depends on three environment variables to be set:
VARSNAP- Should be eithertrueorfalse. Varsnap will be disabled if the variable is anything other thantrue.ENV- If set todevelopment, the client will receive events from production. If set toproduction, the client will emit events.VARSNAP_PRODUCER_TOKEN- Only clients with this token may emit production snapshots. Copied from https://www.varsnap.com/user/VARSNAP_CONSUMER_TOKEN- Only clients with this token may emit development snapshots. Copied from https://www.varsnap.com/user/
Usage
Add the varsnap decorator in front of any function you'd like to make better:
from varsnap import varsnap
@varsnap
def example(args, **kwargs):
return 'output'
Testing
With the proper environment variables set, in a test file, add
from varsnap import TestVarsnap
Troubleshooting
Decorators changing function names
Using decorators may change the name of functions. In order to not confuse
varsnap, set the decorated function's __qualname__ to the original __qualname__:
def decorator(func):
def decorated(*args, **kwargs):
func(*args, **kwargs)
decorated.__qualname__ = func.__qualname__
return decorated
Publishing
pip install twine
python setup.py sdist bdist_wheel
twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 varsnap-1.1.0.tar.gz.
File metadata
- Download URL: varsnap-1.1.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f337bac347017dac00e20c43ed971a701fa89da01dacf8787c7f96d1f3b926c0
|
|
| MD5 |
9cd2adb444dd33bcce99dae5aee7475e
|
|
| BLAKE2b-256 |
effd905154c8d739b3baee3f5d1820b6dd0b637af130ff22c702b32f74408add
|
File details
Details for the file varsnap-1.1.0-py3-none-any.whl.
File metadata
- Download URL: varsnap-1.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3759835d868014b36f4bdd64d5bbc25ff5ab8a7a9d1a7a67ee8c6b5e544f057e
|
|
| MD5 |
020d49bda4cff1302e6bee06e34667ca
|
|
| BLAKE2b-256 |
f6e9e40df42a3405933af089c62aae552ae22ae2adf080bc43e81ba1eff31516
|