No project description provided
Project description
Natura
Natura is little library which handles sending transactions to casino cores.
Installation
$ pip install khidi
Natura currently supports only two merchants Mima and EveryMatrix.
Supported transactions: bet, win and rollback.
Example of making transactions:
example.py
from khidi import MerchantFactory
"""
First argument in MerchantFactory is merchant_name currently you have only two options: mima and everymatrix.
Second argument is schema_type you have four options here:
'decamelize': [{"attrOne": "foo"}, {"attrOne": "bar"}] -> [{"attr_one": "foo"}, {"attr_one": "bar"}]
'camelize': [{"attr_one": "foo"}, {"attr_one": "bar"}] -> [{"attrOne": "foo"}, {"attrOne": "bar"}]
'kebabize': [{'attr_one': 'foo'}, {'attr_one': 'bar'}] -> [{'attr-one': 'foo'}, {'attr-one': 'bar'}]
'pascalize': [{"attr_one": "foo"}, {"attr_one": "bar"}] -> [{"AttrOne": "foo"}, {"AttrOne": "bar"}]
"""
player_obj = {
"_id":"507f1f77bcf86cd799439011",
"bet": 100,
"round_id": "test_round",
"game_id": "test_game_id"
}
merchant = MerchantFactory.build_merchant("everymatrix", "camelize")
merchant.send_bet("https://merchant/bet", 100, player)
merchant.send_win("https://merchant/win", 100, player)
merchant.send_rollback("https://merchant/rollback", 100, player)
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
khidi-0.0.1.tar.gz
(4.0 kB
view hashes)
Built Distribution
khidi-0.0.1-py3-none-any.whl
(9.3 kB
view hashes)