Skip to main content

messagehub: crypto and traditional financial data hub

Project description

messagehub Version MIT License

messagehub: crypto and traditional financial data hub. 消息队列服务: 数字资产和传统资产数据队列服务,当前主要以数字资产为主,包含了传统的OHLCV数据,快讯数据,钱包数据,大额转账数据,DEFI数据,币种市场排名数据。

include: bar data: ohlcv for stock, crypto
flash data: flash news of crypto symbols and stocks
wallet data: blockchain labeling wallet transaction: blockchain symbol large transactions defi data: uniswap pair transactions
info data: coins market rank

Install

$ pip install messagehub

In China:

$ pip install messagehub -i https://pypi.tuna.tsinghua.edu.cn/simple

Usage

import messagehub as mh

token = "getapitokens"
api = mh.api(token)

# get crypto btc ohlcv in binance  获取现货kline数据 
code = "btcusdt"
exchange = "binance"
asset = "spot"
df = mh.bar(code, exchange=exchange, asset=asset)

# get 5m crypto perpetual ohlcv in binance with ma  获取永续合约kline数据
code = "btcusdt"
exchange = "binance"
asset = "perpetual"
freq = "5m"
ma = [7, 25, 99]
df = mh.bar(code, exchange=exchange, freq=freq, asset=asset, ma=ma)

# get 1d crypto perpetual ohlcv in binance with ma and time start end 
code = "btcusdt"
exchange = "binance"
asset = "perpetual"
freq = "1d"
ma = [7, 25, 99]
start = '20200201'
end = '20200802'
df = mh.bar(code, exchange=exchange, freq=freq, asset=asset, ma=ma, start_date=start, end_date=end)

# get flash data 快讯数据(jinse,bishijie,huoxing)
query = ""  
source_name = ""   # support jinse/bishijie/huoxing 
df = mh.flash(query, source_name)

# get wallet data  钱包数据
owner = "binance"
blockchain = "bitcoin"
symbol = "btc"
df = mh.wallet(owner, blockchain, symbol)

# get large transactions 大额转账数据
owner = ""      # binance , huobi ,
blockchain = "bitcoin"
symbol = "btc"
df = mh.transaction(owner, blockchain, symbol)

# get defi transactions 获取defi uniswap pair交易数据
contract_address = "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852"
ret = mh.defi(contract_address, offset=1, limit=100)
print(ret.head(5))
ret.to_csv('defi_eth_usdt.csv', index=None)

# get info 获取支持的币种市场数据
df = mh.info()
df.to_csv('info.csv', index=None)

License

MIT

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

messagehub-0.1.2.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

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

messagehub-0.1.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file messagehub-0.1.2.tar.gz.

File metadata

  • Download URL: messagehub-0.1.2.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for messagehub-0.1.2.tar.gz
Algorithm Hash digest
SHA256 98cc99e5c4ff1fa3153cc35eb36f828498d474d810bd0aa8ff80613be9dc9e75
MD5 58b5c85dcb241102f30945ce51d53eeb
BLAKE2b-256 f5c2ee1ea33e1824f9c67a8ab10eee54dad0ed175302146b19bd4e2af915968a

See more details on using hashes here.

File details

Details for the file messagehub-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: messagehub-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for messagehub-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7d862467463c43efe43f9f8a1dea52d2f9c8ab3de32483f04094cb23dd21c18c
MD5 c8c6d6dd5916e62d1513d97b39d9cadb
BLAKE2b-256 11693589cc8adb47c4f687544e3470dd4d37ad35e6bb4497c18b027c14f6d56d

See more details on using hashes here.

Supported by

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