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.24.tar.gz
(43.9 kB
view hashes)
Built Distributions
Close
Hashes for reddit_decider-1.2.24-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 852cabc9db8e18729304f35db79212f0ff66200c6f112f7edd31e1c22d0faa69 |
|
MD5 | 2237716462b2ec6f8e15bbb2509c9895 |
|
BLAKE2b-256 | 6940478c6cb7d055d95c060b9d4767ffe1dbfbb0beb4055325e74c766cd4bfab |
Close
Hashes for reddit_decider-1.2.24-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea910e0426ddbe1070e0f72e6a09be10298f115a3fa1024cfadfca133a128513 |
|
MD5 | 8018731dd75e9e3bbaf97d327f922fd1 |
|
BLAKE2b-256 | 9c26fa411da192f823c4645be04982050578ad96bf53f3e4ac6a80eb83df5a44 |
Close
Hashes for reddit_decider-1.2.24-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44a4a4dc4876db54e2442461ee4d9c84ae9b86b1a14bc268f61818c9c62fc2b1 |
|
MD5 | 67ee2645373d59aab6a2ace7bb6fe46c |
|
BLAKE2b-256 | ae9b13799f8a0baa47abf0fbf8c08b87d506b123b3b369ae7e8b6a41c36e09bf |
Close
Hashes for reddit_decider-1.2.24-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d30f528b47a3ec90a3e75170345113546dcab3db83343db38027ce6db290e783 |
|
MD5 | 9f85cd9f11432ec76b1c7e9dcb2e207d |
|
BLAKE2b-256 | b7b328bf265c04c7299d8341445f27cbb9aa9bd30b2308e22ca276bbe550e153 |