Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.7.8 instead.
Reason given by maintainers: Use for testing purpose only

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 -q
>>> from moc_prices_source import get_price, BTC_USD
>>>

Get de BTC/USD coin pair

>>> get_price(BTC_USD)
Decimal('89561.50000')
>>> 

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*"

Coinpair    V.    Short description    Exchnage     Response        Weight    %  Time
----------  ----  -------------------  -----------  ------------  --------  ---  ------
BTC/USD     och   Bitcoin to Dollar    MOC onchain  $  89.08900K      1     100  1.66s
BTC/USD           Bitcoin to Dollar    Bitfinex     $  89.18400K      0.18   18  214ms
BTC/USD           Bitcoin to Dollar    Bitstamp     $  89.06700K      0.22   22  553ms
BTC/USD           Bitcoin to Dollar    Coinbase     $  89.06769K      0.25   25  261ms
BTC/USD           Bitcoin to Dollar    Gemini       $  89.05753K      0.17   17  787ms
BTC/USD           Bitcoin to Dollar    Kraken       $  89.05310K      0.18   18  226ms
BTC/USDT          Bitcoin to Tether    Binance        89.19590K      0.65   65  374ms
BTC/USDT          Bitcoin to Tether    Bybit          89.19105K      0.1    10  467ms
BTC/USDT          Bitcoin to Tether    Huobi          89.19650K      0.05    5  472ms
BTC/USDT          Bitcoin to Tether    KuCoin         89.19595K      0.05    5  756ms
BTC/USDT          Bitcoin to Tether    OKX            89.19965K      0.15   15  759ms

    Coinpair              Value   Sources count    Ok   Time
--  ------------  -------------  ---------------  ----  ------
⇓   BTC/USD       89,067.000000      5 of 5            787ms
ƒ   BTC/USD(24h)         0.25%        N/A             2.66s
⛓   BTC/USD(och)  89,089.000000      1 of 1            1.66s
⇓   BTC/USDT      89,195.905000      5 of 5            759ms

Response time 4.36s

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.12+ 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moneyonchain_prices_source-0.7.8b1.tar.gz (72.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moneyonchain_prices_source-0.7.8b1-py3-none-any.whl (139.9 kB view details)

Uploaded Python 3

File details

Details for the file moneyonchain_prices_source-0.7.8b1.tar.gz.

File metadata

File hashes

Hashes for moneyonchain_prices_source-0.7.8b1.tar.gz
Algorithm Hash digest
SHA256 a9a8a537fde2bb3e19153aff8035410f4b8138b91689971583062c2c3ed58c55
MD5 88266e1ddfeb6b34d14c25e318473733
BLAKE2b-256 0d5e9efadde04567a0933226b7e06b9576db17f48fadd646a972b636995b5e7a

See more details on using hashes here.

File details

Details for the file moneyonchain_prices_source-0.7.8b1-py3-none-any.whl.

File metadata

File hashes

Hashes for moneyonchain_prices_source-0.7.8b1-py3-none-any.whl
Algorithm Hash digest
SHA256 e786f8faaea97c2fb98279e26850a1c571a86894472cdfa8cd5a36984b26ebce
MD5 3108d45c0859fd9bee036db127978b80
BLAKE2b-256 1f1648e2cae024f859bb4affe3a1933338ee2d6a55043894fd2afb9626bb9720

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.8

2 files

This release

0.7.8b1 This release

2 files

0.7.7

2 files

0.7.7b2

2 files

0.7.7b1

2 files

0.7.6

2 files

0.7.6b4

2 files

0.7.6b3

1 file

0.7.6b2

1 file

0.7.6b1

1 file

0.7.5

2 files

0.7.4

2 files

0.7.4b35

1 file

0.7.4b33

1 file

0.7.4b32

1 file

0.7.4b31

1 file

0.7.4b30

1 file

0.7.4b29

1 file

0.7.4b28

1 file

0.7.4b27

1 file

0.7.4b24

1 file

0.7.4b23

1 file

0.7.4b22

1 file

0.7.4b20

1 file

0.7.4b19

1 file

0.7.4b18

1 file

0.7.4b17

1 file

0.7.4b16

1 file

0.7.4b11

1 file

0.7.4b9

1 file

0.7.4b8

1 file

0.7.4b7

1 file

0.7.4b5

1 file

0.7.4b3

1 file

0.7.4b2

1 file

0.7.4b1

1 file

0.7.3

2 files

0.7.3b1

1 file

0.7.3b0

1 file

0.7.1

2 files

0.7.0

2 files

0.7.0b10

1 file

0.7.0b8

1 file

0.7.0b5

1 file

0.7.0b4

1 file

0.7.0b3

1 file

0.7.0b2

1 file

0.6.9b3

1 file

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.3

1 file

0.5.2

1 file

0.5.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page