Skip to main content

Python SDK for Cardanoscan API

Project description

cardanoscan-python

Python SDK for the Cardanoscan API, supporting both async and sync usage for accessing Cardano blocks, addresses, transactions, governance, analytics and more.

InstallationUsage API Documentation

Installation

PyPI - Version

Install SDK from PyPi

python3 -m pip install cardanoscan-python

Usage

Create a client

from cardanoscan import Cardanoscan

client = Cardanoscan(api_key="YOUR_API_KEY")

Sync Usage

from cardanoscan import Cardanoscan

client = Cardanoscan(api_key="YOUR_API_KEY")

params = {
    "address": "addr1qxmj3a04rlp95k7428zznkq5ha4ccxwtf5gxught8ykh68l5pfacpmrk44mrauz57eak8m0aes2ywykct2puns9dzj7swe9z76"
}

data = client.get_address_balance_sync(params=params)

print(data)

Async Usage

import asyncio
from cardanoscan import Cardanoscan

async def main():
    client = Cardanoscan(api_key="YOUR_API_KEY")

    params = {
        "address": "addr1qxmj3a04rlp95k7428zznkq5ha4ccxwtf5gxught8ykh68l5pfacpmrk44mrauz57eak8m0aes2ywykct2puns9dzj7swe9z76"
    }

    data = await client.get_address_balance(params=params)
    print(data)

    await client.aclose()

asyncio.run(main())

Using Query Parameters

All optional parameters are passed via params and sent as query parameters.

params = {
    "address": "addr1...",
    "limit": 50,
    "pageNo": 100
}

data = client.get_transaction_list_by_address_sync(params=params)

Development

Install Dependencies

python3 -m pip install -e .[tests]

Run Tests

python3 -m pytest

or with logs

python3 -m pytest -s

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

cardanoscan_python-0.0.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

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

cardanoscan_python-0.0.2-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cardanoscan_python-0.0.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for cardanoscan_python-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4d2f943901ed943a272fc2fb1811452bf002a67d661c5714eb7a75199498cc1c
MD5 7a5848b506cd9579fe010d4896e03da4
BLAKE2b-256 57e74c3a87c3a4f8e20eb59756c57f69601ebe608b64e3064b8e2eb148e15e47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cardanoscan_python-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4386a165e8e53a0d4619e8bfcb088bf075f7bf2ee58770c67b00df6f51aecea7
MD5 af78738d25869891223ff21ee4233300
BLAKE2b-256 349b0ebaafec76540e9132115edd51a3b6ccf906ea96e01ae9a5665545302681

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