Skip to main content

Cardano Python lib to interact with the blockchain

Project description

CardanoPythonLib

Cardano Python Library

This is a Python library to interact with Cardano Blockchain.


  • Prerequesites

    Minimum: Cardano-cli. You will be able to run offchain code, generate keys, create and sign transactions.

    Desired: Cardano-node running. You will be able to submit onchain and get confirmations from the blockchain.

Install poetry

curl -sSL https://install.python-poetry.org | python3 -

poetry new <project_name>

Add dependencies

poetry add cardanopythonlib

The library relies on a cardano_config.ini file which connects to Cardano testnet by default. If you want to overwrite some of the parameters, please create a new ini file in your folder:

[node]
KEYS_FILE_PATH = ./.priv/wallets
SCRIPTS_FILE_PATH = ./.priv/scripts
TRANSACTION_PATH_FILE = ./.priv/transactions
CARDANO_NETWORK = testnet
CARDANO_ERA = babbage-era
CARDANO_NETWORK_MAGIC = 2
CARDANO_CLI_PATH = cardano-cli
URL = http://localhost:8090/v2/wallets/
[logger]
LEVEL=INFO

When using CARDANO_NETOWRK = mainnet the CARDANO_NETWORK_MAGIC is ignored.

Instantiate the class as follows:

from cardanopythonlib import base

config_path = './cardano_config.ini' # Optional argument
node = base.Node(config_path) # Or with the default ini: node = base.Node()
node.query_tip_exec()

Working with the library

cardanopythonlib folder is the package that contains the main functionalities.

base.py file contains 3 classes.

  • Starter
  • Node
  • Keys

For usage please go to docs folder.

Credits:

Latest implementations related to Plutus are based on the following repo:

pycardano

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

cardanopythonlib-1.2.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

cardanopythonlib-1.2-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

Details for the file cardanopythonlib-1.2.tar.gz.

File metadata

  • Download URL: cardanopythonlib-1.2.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.2 Linux/5.4.0-149-generic

File hashes

Hashes for cardanopythonlib-1.2.tar.gz
Algorithm Hash digest
SHA256 d47c9ba7266d2b7d8348ada070803169c7e26cd76c7b6730c97decb1aa8fbfca
MD5 d0f4af8cb8664c01a910b4b7ac68e81b
BLAKE2b-256 74f7eed4a7780baf55975bea109b22a6b8174d495a9fb11da2668e17157aac3f

See more details on using hashes here.

File details

Details for the file cardanopythonlib-1.2-py3-none-any.whl.

File metadata

  • Download URL: cardanopythonlib-1.2-py3-none-any.whl
  • Upload date:
  • Size: 42.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.2 Linux/5.4.0-149-generic

File hashes

Hashes for cardanopythonlib-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 17cd747bbe4f931162bf86aaf0c143070ef905801e321e830a0e9ba0fca622d5
MD5 d2d30dc413106b8e70c6acc6d41461bc
BLAKE2b-256 79fbd91e9d02cd7319a3d88ab80ca6affc304c157321dfac67d4198dfc359baa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page