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.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

cybotrade_datasource-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d7bf4a3a69d41d672c7e0bc5ca5fbbabde5841502111dc946b5468e2a24ddce8
MD5 a6d2b4a457e4d2efce20bb1740257c3b
BLAKE2b-256 1baa06bf02a48c060d56238ec97b0f74605096c307499dfcd402e19c7b2b4948

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 95ac713fbadbf69f190b5158c89d07546f3fb11f52e3b50e03dd242f3c03dd4f
MD5 4fd7b0603b4e5df057452c3879906bdb
BLAKE2b-256 b35c2519db3d36ae0041f6e5861d992fbda014592faa52c2fc6350e95ce85b04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b26448d6eff4bb01aab0c1669ec0be7e60b7c822ea3189e475e5acb9282167e
MD5 090e081f108956a762de3dff5af78a2f
BLAKE2b-256 587a26f0d3ce316023b59b3f4a549077a60cf9131204ec13a18592fe0c9365a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b9e34e8f5e2906e9d33ffbb0d8fbbc9fdb1277753bb6f59327809ec2b34949ac
MD5 b369f8810f3c545e57902d60b03d9bff
BLAKE2b-256 b7d6af7c3383febc3d7e28666e515418bbf92d25cee1476148b4863a2a982548

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee0015cf95627d419edc8ea9cac51a743d274dc8cbfb3d2499a1c9ea225a6e6d
MD5 41e585a6b3e520d9b2a2dd30a7037bad
BLAKE2b-256 702dd393fc9971748626ce4a49f03bf0d8193f19885902db489b1524bf3e033d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1adb8b6d02d4c9a0eda77c30bb3180caca375de3a0784e12951fef6013c459f0
MD5 c3fd5efceefd8ccb19d5a705499c5ae6
BLAKE2b-256 11b5f4fa4512278b52ee3f797adac52b72caa8ebfc5e970ff04651e8ba53eb27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3ca85e4e50dbaaee8f0b824827fc8ee7dd53280b71886e76056bb2733c363a77
MD5 31b0b24968f6dcd15eecdcf6da3a04b3
BLAKE2b-256 46041d2fede75d38c4e465687a71140b6706ef27e9cadebaf615ccf4d609f540

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