No project description provided
Project description
rust_decider
Rust implementation of bucketing, targeting, overrides, and dynamic config logic.
Usage
# In a virtualenv, python >= 3.7
$ pip install -r requirements-dev.txt
$ maturin develop
$ python
import rust_decider
# Init decider
decider = rust_decider.init("darkmode fractional_availability value", "../cfg.json")
# Bucketing needs a context
ctx = rust_decider.make_ctx({"user_id": "8"})
# Get a decision
x = decider.choose("exp_1", ctx)
assert x.err() is None # check for errors
x.decision() # get the variant
# Get a dynamic config value
y = decider.get_map("dc_map", ctx) # fetch a map DC
assert y.err() is None # check for errors
y.val() # get the actual map itself
Development
cd decider-py/
and run maturin develop
to build reddit-decider
python wheel.
Publishing
Package is automatically published on merge to master to https://pypi.org/project/reddit-decider/ via drone pipeline.
Formatting / Linting
$ cargo fmt --manifest-path decider-py/test/Cargo.toml
$ cargo clippy --manifest-path decider-py/test/Cargo.toml
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
reddit_decider-1.2.22.tar.gz
(42.6 kB
view hashes)
Built Distributions
Close
Hashes for reddit_decider-1.2.22-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3614e269d1283d097c145c2b14dd8e38985b97e3c91abde4c7056a890dd2bb07 |
|
MD5 | 3a64c6cde8b6b68232265705e27c5b7a |
|
BLAKE2b-256 | 8536f4bfa014c7059861ae8fa619ae3c8890ebff56e18995dbfb6e3fc2132ebc |
Close
Hashes for reddit_decider-1.2.22-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83c0531f88de7a0c3229614bdd38f2a817df29958782fffbf8e0d18d07cf0943 |
|
MD5 | d2a7fe0e8fcbf364a3822a491ff38422 |
|
BLAKE2b-256 | 729049121bfb8839e3d59ec1a6b90dd19bf76ef9ff7756e1248b2858b53a151f |
Close
Hashes for reddit_decider-1.2.22-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eeaa94b011a816062e088ca96b6348545c31e5ee800f8c6a5f60f2856ab1135 |
|
MD5 | 0255173f3705e5842a7b2bc3cf8c8b09 |
|
BLAKE2b-256 | 3a55703c2ca7e33b3d20cb89424252b88701dd15db09b2accedb34482473b4b0 |
Close
Hashes for reddit_decider-1.2.22-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dacd2ca515a4be383012c4e6715853b81a1fe88bb5a3639de4c6c09a16490bd8 |
|
MD5 | 4a564a34b2af381e0db8814cc9eb252c |
|
BLAKE2b-256 | bffe49795b6d7f087a9c85ce4e14e5f8896a84617236daa9db76a24775e648a6 |