Skip to main content

SDK functions for users to query Data Solutions databases.

Project description

Welcome to the Chainalysis Data Solutions Python SDK

A modern python wrapper for the Chainalysis Data Solutions API Suite.

Documentation

See the latest documentation on all available classes and methods here.

Installation

To install the SDK, run the following command in bash.

pip install chainalysis

Getting Started

Get an API Key at our website by registering an account and navigating to settings in the data solutions product section.

Begin using the SDK with the code below as a sample. The following code snippet details how to import and instantiate the Data Solutions Client to then be used to execute two kinds of queries: Analytical and Transactional.

Analytical queries are queries targeting the data you can view under the 'Explore Data' tab in Data Solutions. Transactional queries are queries targeting data you can find at docs.transpose.io.

    # Import the module
    from chainalysis.data_solutions import DataSolutionsClient

    # Instantiate with an API Key
    ds = DataSolutionsClient({API_KEY})

    # Construct a transactional query
    query = """
        SELECT * from {{chain}}.blocks LIMIT 1
    """

    # Execute the query
    query_results = ds.sql.transactional(
        query=query,
        parameters={
            "chain": "ethereum",
        }
    )

    # OR construct an analytical query
    query = """
        SELECT * FROM cross_chain.clusters WHERE address = '0x00703a0ce5406501c44ca657497c0f785e83dde0' LIMIT 10;
    """

    # Execute the query
    query_results = ds.sql.analytical(
        query=query,
        parameters={
            "chain": "bitcoin",
        },
        polling_interval_sec=5, # How often to check if data is available yet
    )

    # Print the results of the query as a json blob
    print(query_results.json())

    # Return the results of the query as a Pandas Dataframe
    dataframe = query_results.df()

Future

More details on our SDK incoming!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

data_solutions_test_library-0.0.2.tar.gz (537.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

data_solutions_test_library-0.0.2-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file data_solutions_test_library-0.0.2.tar.gz.

File metadata

File hashes

Hashes for data_solutions_test_library-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1248e2d91cbfc8728155c52da8edcde15e73a28b0961937b0553e32840d30238
MD5 418a69460b7a4b0d7638e7c79586d735
BLAKE2b-256 d403092cc5c210f8b50d404f5afc01ba03e5594030ecc06dcbf2908c545937cb

See more details on using hashes here.

File details

Details for the file data_solutions_test_library-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for data_solutions_test_library-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd3a685d9662cadcd443fad247e2d07dfc5038355b6dfef8bbe8b7d204cb5c75
MD5 e4a94922a88f40b0de986c75c64b6e7a
BLAKE2b-256 9f170a0e8658aba5fa1a3cf32a543526c0b52db24a0e6665abb334480023bf1a

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