Python SDK to interact with Cybotrade Datasource API.
Project description
Cybotrade Datasource
Cybotrade Datsource is a financial data broker for the crypto market. This library provides a simple-to-use Python SDK to interact with the REST and Websocket API.
For more information regarding the API, refer to the docs.
Installation
pip install cybotrade-datasource
Usage
To fetch historical data for a particular time range:
import os
import pandas as pd
import asyncio
import cybotrade_datasource
from datetime import datetime, timezone
API_KEY = os.environ["API_KEY"]
async def main():
data = await cybotrade_datasource.query_paginated(
api_key=API_KEY,
topic='cryptoquant|btc/inter-entity-flows/miner-to-miner?from_miner=f2pool&to_miner=all_miner&window=hour',
start_time=datetime(year=2024, month=1, day=1, tzinfo=timezone.utc),
end_time=datetime(year=2025, month=1, day=1, tzinfo=timezone.utc)
)
df = pd.DataFrame(data)
print(df)
asyncio.run(main())
To fetch the latest 10000 data points:
import os
import pandas as pd
import asyncio
import cybotrade_datasource
from datetime import datetime, timezone
API_KEY = os.environ["API_KEY"]
async def main():
data = await cybotrade_datasource.query_paginated(
api_key=API_KEY,
topic='cryptoquant|btc/inter-entity-flows/miner-to-miner?from_miner=f2pool&to_miner=all_miner&window=hour',
limit=10000
)
df = pd.DataFrame(data)
print(df)
asyncio.run(main())
To subscribe and listen to live updates:
import os
import pandas as pd
import asyncio
import cybotrade_datasource
from datetime import datetime, timezone
API_KEY = os.environ["API_KEY"]
async def main():
stream = await cybotrade_datasource.stream(
api_key=API_KEY,
topics=[
'cryptoquant|btc/inter-entity-flows/miner-to-miner?from_miner=f2pool&to_miner=all_miner&window=hour',
'cryptoquant|btc/market-data/liquidations?exchange=deribit&window=min',
],
)
async for msg in stream:
print(msg)
asyncio.run(main())
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 Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cybotrade_datasource-0.1.8-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: cybotrade_datasource-0.1.8-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e55538906be90056db52ac3adfde5600c02e34dc49efeeb028cbab6a646c8fb
|
|
| MD5 |
6471ed22eaa3803e2069e90a89472f0d
|
|
| BLAKE2b-256 |
e5a6d848a84f3099af77f789e75cce9d07e5a1240a00284c1a6c531b40be358a
|
File details
Details for the file cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2865aba79af02e97e6123ca338b21ac38064bd0aaee0045cd71bce416d4096a
|
|
| MD5 |
e5aa957494b33c8f0c10917070f38d07
|
|
| BLAKE2b-256 |
450b74e087df34e1c8d95dab656336f9b58bb110014e3f4b32f7ca8fd785bf95
|
File details
Details for the file cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51716d8067f17d18dece419cfe7ddb63bdfcb9841ad62100e5e878e146b05f02
|
|
| MD5 |
95b7a69578694d7d091e98c6ee67e616
|
|
| BLAKE2b-256 |
da579080040c02398d8ac2f8298ff2da4de7ba878f98c7f5f1c16cd074f3d417
|
File details
Details for the file cybotrade_datasource-0.1.8-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: cybotrade_datasource-0.1.8-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d6596cdc477c707804eb35f6ad5e390b78ba11d6cf010d0eb507cd8cfd487bc
|
|
| MD5 |
91d1816f399b006647e65a5ff2892efd
|
|
| BLAKE2b-256 |
2c854c3f18b8308d854d6b870dcd9263b88cd27a518acee6a99fa2452eb65807
|
File details
Details for the file cybotrade_datasource-0.1.8-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: cybotrade_datasource-0.1.8-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b375b8939be52e1c1047996ced5f1c993762254126c181d9b43620389983e88
|
|
| MD5 |
e656dc7ed6fc9ee80244891f4fbfdb77
|
|
| BLAKE2b-256 |
6b129bd4c433775c24d859faea32fca7dcf16d98bb812090293566422b1e9233
|
File details
Details for the file cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac4574f2fdec9b56f57e925e78f559950534e1ac8dd309e5b74344c9eb17ab20
|
|
| MD5 |
c876f07541a15d5ae6320b03847c8b4d
|
|
| BLAKE2b-256 |
c329c7007c2c1c5dcc5a9a287816925225c1dd49858923c32bb1255d7ac395f9
|
File details
Details for the file cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59ac1761b7bdb5152d94586b4cc7fc0f83fae32ed5b7ebd1b6eb12d51f36296a
|
|
| MD5 |
43c8b7edfbf829908b786782b897a25c
|
|
| BLAKE2b-256 |
b3af9b309b51fe3b6add8a79e4a80b09b51282e0d71fc29de5a92a3831199d1d
|
File details
Details for the file cybotrade_datasource-0.1.8-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: cybotrade_datasource-0.1.8-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2840a33e5c94ed26c483bd69bfa546d01194dc2ddff98bee610e32a3dd417a9d
|
|
| MD5 |
837dbd261779cea409912c72d321ff8a
|
|
| BLAKE2b-256 |
bf537059b9cab1b11112bc4f34b8f0b698626d12c59610b54b6d47b264b48dbe
|