Prices source for MoC projects
Project description
MoC prices source
This is the python package used in Money on Chain projects where it is required to get the coinpair values directly from the sources. This package includes a CLI tool that allows you to query the coinpair values in the same way that Money on Chain projects do.
How to use it in your project
A simple example, do some imports first
user@host:~$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from moc_prices_source import get_price, BTC_USD
>>>
Get de BTC/USD
coin pair
>>> get_price(BTC_USD)
Decimal('29395.82')
>>>
And that's it!
More usage examples can be seen here
How the included CLI tool looks like
Here you can see how the output of the moc_prices_source_check
command looks like
user@host:~$ moc_prices_source_check "BTC/USD"
From To V. Exchnage Response Weight % Time
------- ------ ---- ---------- ------------ -------- --- ------
Bitcoin Dollar Bitfinex $ 67.10800K 0.18 18 1.64s
Bitcoin Dollar Bitstamp $ 66.99300K 0.22 22 1.82s
Bitcoin Dollar Coinbase $ 66.98946K 0.25 25 1.42s
Bitcoin Dollar Gemini $ 67.01356K 0.17 17 2.05s
Bitcoin Dollar Kraken $ 67.00500K 0.18 18 1.64s
Coin pair Mediam Mean Weighted median Sources Ok
-- ----------- -------- ------- ----------------- --------- ----
↓ BTC/USD 67005 67021.8 67005 5 of 5 ✓
Response time 2.06s
user@host:~$
This command has many options. you can run moc_prices_source_check --help
to get help on how to run them.
More information about this CLI tool can be seen here.
References
Requirements
- Python 3.6+ support
Installation
From the Python package index (PyPI)
Run:
$ pip3 install moneyonchain-prices-source
And then run:
$ moc_prices_source_check --version
To verify that it has been installed correctly
From source
Download from Github
Standing inside the folder, run:
$ pip3 install -r requirements.txt
For install the dependencies and then run:
$ pip3 install .
Finally run:
$ moc_prices_source_check --version
To verify that it has been installed correctly
Supported coinpairs and symbols
Here you can find an summary of supported coinpairs and symbols
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
Built Distribution
Hashes for moneyonchain_prices_source-0.7.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39dd1889878a65d47c95d6b5e2d38e70f397a1bd88dcf1e9f734c10deaf20a06 |
|
MD5 | 2df3fd4f6e4ba6e7877da2bb0fe7ac59 |
|
BLAKE2b-256 | ecb1ac4c317746d66eaa4f26c097209eedd8682096e9d8a8e2f8ad9960f63dff |
Hashes for moneyonchain_prices_source-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f00ccd26d4a0c6e1a36bfb35a5cce81fe531f383e4b9a4ebfc06ce740249ac4 |
|
MD5 | 8fa8f02379d6c08495a3891728b7c9dc |
|
BLAKE2b-256 | 0415adcda6a19715cc03cc6103149fd0d7a339061a3f173a6b563ddca0a1d691 |