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.1-cp312-cp312-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.12Windows x86-64

cybotrade_datasource-0.1.1-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.1-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.1-cp312-cp312-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cybotrade_datasource-0.1.1-cp311-cp311-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11Windows x86-64

cybotrade_datasource-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

cybotrade_datasource-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

cybotrade_datasource-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cybotrade_datasource-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

cybotrade_datasource-0.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

cybotrade_datasource-0.1.1-1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 faba8aa9a804886b10da7605dbd82b8653faf8c19533c7cde58459bddd2731ee
MD5 693e14d902c7a6f6066c121dd1501df1
BLAKE2b-256 2747c562a4e7178d102c423ce21e2a01aedef771c3ffbdf9f32762a25c799a60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d9f1d040cf33df85c0490c348179e983778fcd6c311ae4e7e2ab3aa20bf8056
MD5 51d04bb3748c0844da74c4e7b969e504
BLAKE2b-256 67b35085e4222d2f90c7a45fd2dc8342d76e4f4e5dec27a5358937caf0ac18f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 32dff87b08afd0b3a09fbc0df23a52cf1e0be611325afa3172dddd557603fdf1
MD5 811e68e6b8f9cbaec3ee6b78791f53fd
BLAKE2b-256 49690edb40318f5e80415a8e49558113ab31a9cf7f312fb94cfcd59f3d644f52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 999b338aa231231b51009dd85b0b528dcaa049ac07eba527ed353e3c3902f5d6
MD5 5d1d8160bc31e6554e7daa802d9074f4
BLAKE2b-256 0faa700d31ef086c30062e9fa5fa2b42db5020cdaba136b365c594bd3e48b333

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e1bccb135bfcf1240af4f1061efa9fcbc39a981c760ceae0bc9f200ff1e13669
MD5 ef260e5fc9c196a9dd11b7a6b3812526
BLAKE2b-256 d99da9f90aec42e0ae4314650f6fe1833da83b62a84e769ec7ad7d4d38e10955

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 faf486a97d1073178416ca6b003235a04f107679bdbeb10a3b2a36ba328101c7
MD5 5c3746990eb709d7be1cef89596b1eca
BLAKE2b-256 853a153abb97b7bb6b374bcd7e23f8f9bca9b81ee05b1581dde6ab3dbc61ae91

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 badda0b345b71f7e40876edab2e6b9261490c6dfa6f15999a3b5992e69adab65
MD5 8e2f99111d6067db90d6949556a991f2
BLAKE2b-256 36f185f72c7ebf2db0d791a536db46813ecea4109a2fd911ffba2bf268830a6d

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5dc208974f894bb316253f4f09c2305ca07da4a326c00b5a9530e98fe532643a
MD5 fc814972e6b4f65039145f40bbf356e1
BLAKE2b-256 d58c1850076516bc20348c1d312a7c68c1e9c24a14d2813e3cb16eb90b2ab4de

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e7e75d857fc18c21d346238634b266466e222994020b87fc96a5336c020e4079
MD5 b47efba0fb232520cf83391048aef002
BLAKE2b-256 036531aa794f1bde85b7403d80d6f735d965b6a0c3ccb7fab8a02fd5d0b122e4

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 70574dc8dc371ae34c86214a1d687fa3cea31734398c4ea61acbecc57a6730de
MD5 43e37c28fb7b2009b957c07aded9e4ae
BLAKE2b-256 0ed2eefb2ba7485f6099a80369bb80b2120577328b4a8ca21a790d4deb34c505

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.1-1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.1-1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4c1736d194cdee838297f9935ae82feed46576b56a60b3b2c5a6a21ea12e09f2
MD5 6bfad9b191ce55ac750170bc90a352ca
BLAKE2b-256 7cfaec8325d97c0953b4356c10d3c9431a654404338c796b0b62d7072eed3c1a

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