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.19.tar.gz
(42.3 kB
view hashes)
Built Distributions
Close
Hashes for reddit_decider-1.2.19-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 576ec3da6f072d289244a908d141080fdaaac6942dee819402c3105b6b39c67b |
|
MD5 | 7965b2cf395321d46ded22b4067c3978 |
|
BLAKE2b-256 | 59f9393c9960822afbe1a9b7801f0bceed5caea3a75c81c6f851a2d77c09aba3 |
Close
Hashes for reddit_decider-1.2.19-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c7b9ea1c02b81567246105be943afb706d02bbdde492f6ae921a198c43e7dc4 |
|
MD5 | 8a60bfbd17923b3604ac530c6c283780 |
|
BLAKE2b-256 | 8855d1ebe85ad5244456d541cf2072f4cf4db6191f881af93edbbb3293a1cc24 |
Close
Hashes for reddit_decider-1.2.19-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81a419de39083179236fd41dc91352f202e5d85a7219facb931646876fc91554 |
|
MD5 | bf0418d16dc974432ef42ef918781f41 |
|
BLAKE2b-256 | a35456b688844c2daa15d3966ba660b273192adee011421e131a5d63a43c6cc8 |
Close
Hashes for reddit_decider-1.2.19-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80923924cd1f3f5708a521bf9656164f89e8fa25cec384ae4196174b64da752e |
|
MD5 | 98a5ef6d6ee3aec5efaf6d61e4bc35df |
|
BLAKE2b-256 | 1951a59c20ce196454dd0828a1e94a20ded97a88b5eee8660bd5ad7db5e4f236 |