Skip to main content

A utility library that wraps grabbing the current spot price of $XRP from various exchanges.

Project description

xrp-price-aggregate

Based on XRPL-Labs/XRP-Price-Aggregator

Usage

  1. pip install

  2. Run directly as a module or import and provide aggregation count (how many rounds) along with delay between each round.

     # run xrp_price_aggregate.__main__ and also beautify the results
     python -m xrp_price_aggregate | python -m json.tool
     {
         "raw_results_named": {
             "bitstamp": [
                 "0.71477"
             ],
             ...
         },
         "raw_results": [
             "0.7146",
             ...
         ],
         "raw_median": "0.7146375",
         "raw_stdev": "0.2259129230993412844271423067",
         "filtered_results": [
             "0.71460",
             "0.71567",
             ...
         ],
         "filtered_median": "0.71468",
         "filtered_mean": "0.71439"
     }
    
    >>> # await it yourself
    >>> import asyncio
    >>> import xrp_price_aggregate
    >>> asyncio.run(xrp_price_aggregate.as_awaitable_json())
    '{"raw_results_named": {"hitbtc": ["0.711729"], "binance": ["0.7131"], "bitrue": ["0.71292"], "bitfinex": ["0.7122"], "ftx": ["0.712675", "0.7126"], "kraken": ["0.71223"], "cex": ["0.71334", "0.7135"], "bitstamp": ["0.71328"]}, "raw_results": ["0.7131", "0.7122", "0.71328", "0.71334", "0.7135", "0.712675", "0.7126", "0.711729", "0.71223", "0.71292"], "raw_median": "0.7127975", "raw_stdev": "0.0005759840275563203497399309551", "filtered_results": ["0.71310", "0.71328", "0.71334", "0.71268", "0.71260", "0.71223", "0.71292"], "filtered_median": "0.71292", "filtered_mean": "0.71288"}'
    
    >>> # synchronous is the default case
    >>> import xrp_price_aggregate
    >>> xrp_price_aggregate.as_dict()
    {'raw_results_named': {'hitbtc': [Decimal('0.720423')], 'kraken': [Decimal('0.72032')], 'bitrue': [Decimal('0.72003')], 'bitfinex': [Decimal('0.71992')], 'ftx': [Decimal('0.71995'), Decimal('0.7202')], 'cex': [Decimal('0.71961'), Decimal('0.71869')], 'bitstamp': [Decimal('0.71994')], 'binance': [Decimal('0.7203')]}, 'raw_results': [Decimal('0.7203'), Decimal('0.71992'), Decimal('0.71994'), Decimal('0.71961'), Decimal('0.71869'), Decimal('0.71995'), Decimal('0.7202'), Decimal('0.720423'), Decimal('0.72032'), Decimal('0.72003')], 'raw_median': Decimal('0.71999'), 'raw_stdev': Decimal('0.0005005397198136338821186646099'), 'filtered_results': ['0.72030', '0.71992', '0.71994', '0.71961', '0.71995', '0.72020', '0.72042', '0.72032', '0.72003'], 'filtered_median': '0.72003', 'filtered_mean': '0.72008'}
    

Project details


Download files

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

Source Distribution

xrp-price-aggregate-0.0.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

xrp_price_aggregate-0.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file xrp-price-aggregate-0.0.1.tar.gz.

File metadata

  • Download URL: xrp-price-aggregate-0.0.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10

File hashes

Hashes for xrp-price-aggregate-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f9e3fb6caf6ae233377e1f7468d91b2b2239485c23949ac0324b6ff24d86816a
MD5 d806c43cc70cc93fbf3dd52fcc2afbbc
BLAKE2b-256 aee8edde411d4c45cf9ee7d22c8353d2f37323be7c9b8f8763fca25a1944d521

See more details on using hashes here.

File details

Details for the file xrp_price_aggregate-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: xrp_price_aggregate-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10

File hashes

Hashes for xrp_price_aggregate-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d90f238aa23053c28c500ec8fc37ea9720f26bf92bf7f4fd402df8f6b52e1262
MD5 dbd79dc31fd73c5012882a621825a0e9
BLAKE2b-256 048715ce2fff53ce57477a634d8a94c695b11e0844f1dbc3817dd805df0f03f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page