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

Uploaded CPython 3.12macOS 11.0+ ARM64

cybotrade_datasource-0.1.2-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.2-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.2-cp311-cp311-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cybotrade_datasource-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

cybotrade_datasource-0.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

cybotrade_datasource-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

cybotrade_datasource-0.1.2-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.2-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.2-cp39-cp39-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 174903e9a050e69ce8abcec87b29966106b66d392118c11b4f42b4d976316cc4
MD5 195701b2e22c220594da5ee2f3b9a4f4
BLAKE2b-256 e93d72c7e6d4bc9f97879abe018410012f74096b3e1b1916069848586301c396

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d9eb72834c23a8ee6bec67a921f68a70e6d8dc6efa6331ac8a97f18f181d510f
MD5 a2ce555817a8e6eaebe488d55808dcf5
BLAKE2b-256 98e1033053df3ebc38e2c1e6576185029df988323df3d5bcce04098b2369d645

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8521fb3233855e5aa3ecee1792075d3dc90f2524dedbf8dfcc5e32c7cb75d7d2
MD5 31a9582756ea785eb411fd0812459f31
BLAKE2b-256 6ccff69cf2d5bac45c586a4e03fcc5a013eff94d4318b1751a0b1af3c146c0fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 528223fb139c93a955f7d295149a0036602e1d8584e4c877973601037be18bce
MD5 716c1f703a3fb3d9a2ab1b2cb6069ee1
BLAKE2b-256 42dbd467a6ad79516b02ae9afa3339c6b96dd42d181d161e4ab9b6a5c85b7388

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 063076d3d19fd33a16ffa663d900c43446694f8848ea8ffb082131ca01e624a2
MD5 fc9acc1f0325f1f8825f4d4766469269
BLAKE2b-256 cdce6eadb0fad3c69eb30adddae96a436d28db3953779ea310cbfd71b924af0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 89120c6a8b5050dceb9c90341ca684d846f8084758a7ee56ad96e7aa21086b1f
MD5 1919d28bbb9edbae30bdd78fd30e82fb
BLAKE2b-256 cdddef1d4d839c70093eb2811570183847b27d8b2f348420b9e22f32196da27e

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2f4ec15e9419945fff165efa14ed90c71d2e8f6cbc56ca3d959ef273685cc24
MD5 f68efa0e88353041a545f4b7e6823f58
BLAKE2b-256 7690c6f8e48ca3e5dac8e88cec12ee9cf23dc79007ef2349f747950fdd79966c

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 86bb93dfb17e900248bdaef8e5b6f7fb37c1a17913d4ea1bb4118f37ff173919
MD5 0b796a0cc5baeeb4b4d7b15b6c4526a7
BLAKE2b-256 37b9eb1a95e02823600416c5c049591b3ad6dab2f48f38b9c142a1c846b02947

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 420dfbb8c74bf51ee5bc3a370fd0f8ad2d6cf455258f9fe9b0ae3f6d467dcdd4
MD5 b0cd421237ac88ddf8e1c9864fe1f0f8
BLAKE2b-256 de063c732b390ac566ea591c72fca5f611bffdc9d5f5c4da0c4ba4c986849294

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ece37ea8d8add1924c077de72624f3d40d73d4378a9dc8a45f8d280455b801ed
MD5 c8e17e40faefe3a964f89fb5d52897ab
BLAKE2b-256 3fc96c5457d9dec67a329c40d58b3ebb3357f2342a28fb4805556c17323d305a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4f76da481b8299d1ee5de0819db4a8887ebee7b6f82a597580aee5a203e7cf62
MD5 85828cbcc4554df28d51147dcb442826
BLAKE2b-256 aeb7a940e5df4a5c883f4c3b803b83d6d5e0c00bd60cb27f97ea4c1fd59fc91f

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.2-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 024ffc41cd4e2a3f2d8f6272850b55d788d1e97e621ba821fd9766ce7969dc4c
MD5 7af6dffb6369cbbbf5773c348c38c27b
BLAKE2b-256 dcc91a8e55a5c80732603176e1e4e50331eafacd8c2917bce36e2f75a87202a4

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