Skip to content

StricaHQ/cardanoscan-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages