PyCardano is a standalone Cardano client written in Python. The library is able to create and sign transactions without
depending on third-party Cardano serialization tools, such as
cardano-cli and
cardano-serialization-lib, making it a light-weight library that
is easy and fast to set up in all kinds of environments.

Current goal of this project is to enable developers to write off-chain and testing code only in Python for their DApps.
Nevertheless, we see the potential in expanding this project to a full Cardano node implementation in Python, which
might be beneficial for faster R&D iterations.





Workspace setup

Clone the repository:

git clone

PyCardano uses poetry to manage its dependencies.
Install poetry for osx / linux / bashonwindows:

curl -sSL | python -

Go to poetry installation for more details.

Change directory into the repo, install all dependencies using poetry, and you are done!

cd pycardano && poetry install


PyCardano uses pytest for unit testing.

When testing or running any program, it is recommended to enter
a poetry shell in which all python dependencies are automatically
configured: poetry shell.

Run all tests:


Run all tests including doctests:

pytest --doctest-modules

Run all tests in a specific test file:

pytest test/pycardano/

Run a specific test function:

pytest -k "test_transaction_body"

Run a specific test function in a test file:

pytest test/pycardano/ -k "test_transaction_body"

Test coverage

Test coverage could be checked by running:

pytest --cov=pycardano

A coverage report visualized in html could be generated by running:

pytest --cov=pycardano --cov-report html:cov_html

The generated report will be in folder ./cov_html.

Style guidelines

The package uses
Google style docstring.

The code style could be checked by flake8: flake8 pycardano

Docs generation

The majority of package documentation is created by the docstrings in python files.
We use sphinx with
Read the Docs theme to generate the
html pages.

Build htmls:

cd docs && make html

Go to the main page:

open build/html/index.html


Feature Status
Shelly address Supported
Transaction builder Supported
Transaction signing Supported
Multi-asset minting Planned
Native script Planned
Plutus Planned
Byron Address Planned
Reward withdraw Planned
HD Wallet
Staking certificates
Protocol proposal update


View Github