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

Uploaded CPython 3.14Windows x86-64

cybotrade_datasource-0.1.9-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

cybotrade_datasource-0.1.9-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

cybotrade_datasource-0.1.9-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (5.6 MB view details)

Uploaded CPython 3.14macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

cybotrade_datasource-0.1.9-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

cybotrade_datasource-0.1.9-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.9-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (5.6 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

cybotrade_datasource-0.1.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cybotrade_datasource-0.1.9-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.9-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (5.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file cybotrade_datasource-0.1.9-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d740035aabed58065f739cf8770dd10c2a6259344bfa84d071c21619e1d25132
MD5 1f26c2ee8fc6a8411978936a5e1e8062
BLAKE2b-256 f537fe0936af574ad625f1dd2283a0dc6a692a074f17b97c28a58141e380d0fe

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.9-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 400fbc3f2a418545a1c2e41bea6e40d238c21dea5aa1a5554ba2f8398752a872
MD5 d4245529524cecec81676c0324216237
BLAKE2b-256 a5874cb27922872e4d99adbe25b37a82142b359baef6fec4ca3bd79a62bcf956

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.9-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aa803415cc10845d444cefd76fdb5e6f80f3cf3c16e1228df25e63549e1621b6
MD5 ed26f9185a0ff736f70ca8ec9141b788
BLAKE2b-256 e5e7a25cab729d4a61f4320363f31be1475ccfaa46e7ccacf6477fe923a73b0d

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.9-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 ae3d962d2581f61af82ca616ee61934d9455ada515609dcf6f03250f4fd13147
MD5 52864f8518bf0c017cc8e076dbb4ccdf
BLAKE2b-256 7609e5f0643dc6b1b2c42f2253497e6506f5fbd031209828a7471c23a19d1712

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3521275e4d6499bc31dce8f638154ab8f200c6219f36f3b7dcd7456b8745837d
MD5 de95d26190acc681cea22652f46d655b
BLAKE2b-256 3013649791aa6b7fe377decb29e877cc31ecffa2e7840ee1ac68230672a33cb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ed169d285c04b53f8f44448886f997dceff58e15df3958b237c242802d66be35
MD5 961e4ee3cc548d25bbbe96f9594f1f15
BLAKE2b-256 ccfba3a259bb8ad1c813109ed661d37f5fa62c8de955e9fe9c450ddc2dc490e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9fac92619245498c6e45a4f08b5523e717934fb56f01aa5f19c221c8b6a5c6f5
MD5 739c0b4e0bde195730c06833df1bcd34
BLAKE2b-256 c1b51529d0793d402e83225e59347f956a8e7daf56bc59829b4cf3cd741679db

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.9-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 3d94382cc4a5626a8c1cfb06f6be96022488668345a020d1709f19b614f7f567
MD5 66ed7395e3903d7671b62c930a7a7d3b
BLAKE2b-256 c8de9b698fc577345efe57cffe540dc44fc22095291d720f0e1c9c5b5de31e7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7ea2b1b73c1b4fff366d9f1c088e35579ff0cbeab7fc7d5799dc08c54a2584dd
MD5 6f4b090e3b66181ca95ccda7a9e64814
BLAKE2b-256 2f5a4a30f492ade3cad2c37d3118b881504d66762681bc70c7aa5f7b3ddd57cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 398f74a9362f47db828d13a63154a65df449cd579063fc708557ddf38d561c32
MD5 f7a19cf3b591f50ab9a147bd70c3a129
BLAKE2b-256 9539d5782e0f874362713f61e93440f7df50791d3b56ce48ad792e72fbbcea8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 37e690f14043051f0ffca9fdce20b08924641ed64dda564dbb13303ecb56fe0e
MD5 08f947dfb6a8f7c13cbd82c1bcc16299
BLAKE2b-256 2ff3df101c70ef487d3b8f197feed39b05a4d41c0bcb494eaf2e8c67e6b5ccba

See more details on using hashes here.

File details

Details for the file cybotrade_datasource-0.1.9-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for cybotrade_datasource-0.1.9-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 97059dca1c120ccfe2c98c289221453aa10574067f6d46437d34ea78d6b7cf44
MD5 56353cf57224fe9d146a823a62cc5982
BLAKE2b-256 010a014a357d568d04f38cbcbb333213d64306e597a2423db4d019e0cadf60ac

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