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 $ 29.45100K 0.18 18 0.9s
Bitcoin Dollar Bitstamp $ 29.39500K 0.22 22 0.9s
Bitcoin Dollar Coinbase $ 29.39194K 0.25 25 0.71s
Bitcoin Dollar Gemini $ 29.40548K 0.17 17 1.09s
Bitcoin Dollar Kraken $ 29.38410K 0.18 18 0.71s
Coin pair Mediam Mean Weighted median Sources
-- ----------- -------- ------- ----------------- ---------
↓ BTC/USD 29395 29405.5 29395 5
Response time 1.1s
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.6.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8e560194cf3a60643c167aeec0ff2615aa242d056666d76426dc2b204d507a5 |
|
MD5 | fe9a8ad82d3711e8ea19e459e8c6b7aa |
|
BLAKE2b-256 | a2325db33e72d166f4d2344e7221d0f9adbc794a3a97dc9ba8f5531e0de4e2d2 |
Hashes for moneyonchain_prices_source-0.6.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2211f0417bcb880d6e5b3f818769235acbb9ea9f7b204f5e382ac45409ce3d46 |
|
MD5 | b63b5ed6223792192ed60722f650bf84 |
|
BLAKE2b-256 | 84c5355320bf98c786b7cb900e630ff57d92ace65ac13f3f4db331c0544dfd36 |