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.7-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.7-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.7-cp313-cp313-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cybotrade_datasource-0.1.7-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.7-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.7-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.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 774472814df31b53a681ca9acdede07a90e57bd22dd50674303283b8902310a9
MD5 3dc98ed367373731087ea87139b97306
BLAKE2b-256 0faa3ecc7e73d17a6e3b8ec8e8b4601857aceda0f8b4cf8dc6027c0aa353fc2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 eb7a043936d494fba5a01f094ab726bad866bda5760352a74417567e55601ea0
MD5 14e9c78b579f4a9978256402d2e04c16
BLAKE2b-256 52bb815fbdcb397639a19e06b881b001d4c0fd9a946add7728d709c6182be317

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb3b3f679ea3640abc6f7f2c489bd571d0ef22bcf148913b731f4b3e3612e24f
MD5 7c7852f9cf40496070ef716529b79b05
BLAKE2b-256 5070554a13e84efa1cdc42f83e5ee9f044116779d0504e0cdd137bf06bc5cbbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6598ff3b0311a4203068206ba30826093af642716e6146571ddd58ce91d39bf3
MD5 aa7040b9126572042113dcec6d2e936f
BLAKE2b-256 13844187c43f9b0fcb80eca4f2c48986a96d2f17203af4fc5702cd280071f754

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 465182bd0737256d5510dfa069e30d25997b528c017d2be7355705316e0962c0
MD5 a7e254d0d18cf1be00e4a81d91f4cb3a
BLAKE2b-256 377348db4dc45d862dcaa1c7146d8f834fe18c4487efdfd85948cfd0a15d9088

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2407ebeb5ca61feb25bfd31d3f62fa2f1a20822125395c13175ae27f05383e4
MD5 e156d1564cd29f82d096c6bb094f5890
BLAKE2b-256 43f5cd13d53963d4aa1756cb78f161c4767797730428e0eea50d398d59456760

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