Python SDK for Numerator Feature Management Platform
Project description
Numerator Python SDK
Quickstart
- Create a subclass of
NumeratorFeatureFlagProviderand define feature flags:
from numerator.config import NumeratorConfig
from numerator.context import SimpleContextProvider
from numerator.feature_flags import NumeratorFeatureFlagProvider
class ExampleFeatureFlagProvider(NumeratorFeatureFlagProvider):
def __init__(self, config: NumeratorConfig):
self.config = config
self.context_provider = SimpleContextProvider()
super().__init__(self.config, self.context_provider)
self.init_feature_flag('basic_boolean_flag', False)
self.init_feature_flag('basic_string_flag', 'Hello World')
def is_basic_feature_enabled(self) -> bool:
return self.get_feature_flag('basic_boolean_flag').value()
def get_string_value_for_context(self, context: dict) -> str:
return self.get_feature_flag('basic_string_flag').value(context)
- Use the above feature flag accessors in code:
feature_flags = ExampleFeatureFlagProvider(config)
if feature_flags.is_basic_feature_enabled():
# feature enabled logic
text = feature_flags.get_string_value_for_context({ 'user': '...' })
else:
# feature disabled logic
Advanced Usage
TODO
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
numeratorpy-0.0.3.tar.gz
(7.4 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 numeratorpy-0.0.3.tar.gz.
File metadata
- Download URL: numeratorpy-0.0.3.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36935ed2f6f6828f24e552dbf0bb8ea31d8100500250ac637c503831afe75288
|
|
| MD5 |
b5ef91699db1800304d97e5009a1c6e1
|
|
| BLAKE2b-256 |
c54e41ec956a3a9c317693f7f09f52065f0240f39ad281a278389f27e826f8e3
|
File details
Details for the file numeratorpy-0.0.3-py3-none-any.whl.
File metadata
- Download URL: numeratorpy-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15f18eca7a348f0e2771c59540b73ddc29f38ef3ca5fac695e32b61bbbf62a09
|
|
| MD5 |
d2a838a8d56b36c329d0f3580478f19b
|
|
| BLAKE2b-256 |
9a9a24e5ce2fe3f172a2e367cc0c2accaa7120e45d0a6e08334d1094a7b437b8
|