No project description provided
Project description
Spackle Python Library
The Spackle Python library provides optimized access to billing aware flags created on the Spackle platform.
Documentation
See the Python API docs.
Setup
Install the Spackle library
pip install -U spackle-python
Configure your environment
In order to use Spackle, you need to configure your API key on the spackle
module. You can find your API key in Spackle app settings page.
import spackle
spackle.api_key = "<api key>"
Bootstrap the client (optional)
The Spackle client requires a single initialization step that includes a network request. To front load this process, you can call the bootstrap
method in your codebase.
spackle.bootstrap()
Usage
Fetch a customer
Spackle uses stripe ids as references to customer features.
customer = spackle.Customer.retrieve("cus_00000000")
Verify feature access
customer.enabled("feature_key")
Fetch a feature limit
customer.limit("feature_key")
Logging
The Spackle Python library emits logs as it performs various internal tasks. You can control the verbosity of Spackle's logging a few different ways:
-
Set the environment variable SPACKLE_LOG to the value debug or info
$ export SPACKLE_LOG=debug
-
Set spackle.log:
import spackle spackle.log = 'debug'
-
Enable it through Python's logging module:
import logging logging.basicConfig() logging.getLogger('spackle').setLevel(logging.DEBUG)
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
Hashes for spackle_python-0.0.31-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d98fe2a866539062111e312ee454b9502db7ae489dd6ebed697fd33c72a3bfa2 |
|
MD5 | cb7d14f5a47861169cba4a18347e4162 |
|
BLAKE2b-256 | cdafe8d4f1d450c8863f73e802054bebe96408c2e4b28dccd31e73b5371175c7 |