Skip to main content

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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

cybotrade_datasource-0.1.8-cp313-cp313-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.13Windows x86-64

cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

cybotrade_datasource-0.1.8-cp313-cp313-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cybotrade_datasource-0.1.8-cp312-cp312-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.12Windows x86-64

cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

cybotrade_datasource-0.1.8-cp312-cp312-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file cybotrade_datasource-0.1.8-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6e55538906be90056db52ac3adfde5600c02e34dc49efeeb028cbab6a646c8fb
MD5 6471ed22eaa3803e2069e90a89472f0d
BLAKE2b-256 e5a6d848a84f3099af77f789e75cce9d07e5a1240a00284c1a6c531b40be358a

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2865aba79af02e97e6123ca338b21ac38064bd0aaee0045cd71bce416d4096a
MD5 e5aa957494b33c8f0c10917070f38d07
BLAKE2b-256 450b74e087df34e1c8d95dab656336f9b58bb110014e3f4b32f7ca8fd785bf95

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.8-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 51716d8067f17d18dece419cfe7ddb63bdfcb9841ad62100e5e878e146b05f02
MD5 95b7a69578694d7d091e98c6ee67e616
BLAKE2b-256 da579080040c02398d8ac2f8298ff2da4de7ba878f98c7f5f1c16cd074f3d417

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.8-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.8-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8d6596cdc477c707804eb35f6ad5e390b78ba11d6cf010d0eb507cd8cfd487bc
MD5 91d1816f399b006647e65a5ff2892efd
BLAKE2b-256 2c854c3f18b8308d854d6b870dcd9263b88cd27a518acee6a99fa2452eb65807

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.8-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2b375b8939be52e1c1047996ced5f1c993762254126c181d9b43620389983e88
MD5 e656dc7ed6fc9ee80244891f4fbfdb77
BLAKE2b-256 6b129bd4c433775c24d859faea32fca7dcf16d98bb812090293566422b1e9233

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac4574f2fdec9b56f57e925e78f559950534e1ac8dd309e5b74344c9eb17ab20
MD5 c876f07541a15d5ae6320b03847c8b4d
BLAKE2b-256 c329c7007c2c1c5dcc5a9a287816925225c1dd49858923c32bb1255d7ac395f9

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 59ac1761b7bdb5152d94586b4cc7fc0f83fae32ed5b7ebd1b6eb12d51f36296a
MD5 43c8b7edfbf829908b786782b897a25c
BLAKE2b-256 b3af9b309b51fe3b6add8a79e4a80b09b51282e0d71fc29de5a92a3831199d1d

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.8-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2840a33e5c94ed26c483bd69bfa546d01194dc2ddff98bee610e32a3dd417a9d
MD5 837dbd261779cea409912c72d321ff8a
BLAKE2b-256 bf537059b9cab1b11112bc4f34b8f0b698626d12c59610b54b6d47b264b48dbe

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