{"library":"pycardano","title":"PyCardano","description":"A Python library for interacting with the Cardano blockchain. Supports transaction building, staking, native assets, smart contracts (Plutus), and integration with blockfrost, ogmios, and kupo. Current version: 0.19.2. Release cadence: roughly monthly.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pycardano"],"cli":null},"imports":["from pycardano import PaymentSigningKey","from pycardano import TransactionBuilder","from pycardano import BlockFrostChainContext"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom pycardano import (\n    PaymentSigningKey,\n    PaymentVerificationKey,\n    Address,\n    BlockFrostChainContext,\n    TransactionBuilder,\n    TransactionOutput,\n    Value,\n    Network\n)\n\n# Generate a key pair\nsigning_key = PaymentSigningKey.generate()\nverification_key = PaymentVerificationKey.from_signing_key(signing_key)\n\n# Derive address (testnet)\naddress = Address(payment_part=verification_key.hash(), network=Network.TESTNET)\nprint(f\"Address: {address}\")\n\n# Create a chain context (use Blockfrost API key from env)\ncontext = BlockFrostChainContext(\n    base_url=\"https://cardano-testnet.blockfrost.io/api/v0\",\n    project_id=os.environ.get(\"BLOCKFROST_PROJECT_ID\", \"\")\n)\n\n# Build a simple transaction (requires actual UTXOs and funds)\ntry:\n    builder = TransactionBuilder(context)\n    builder.add_output(TransactionOutput(address, Value(1000000)))\n    tx_body, tx_hash = builder.build_and_sign([signing_key], change_address=address)\n    print(f\"Transaction hash: {tx_hash}\")\nexcept Exception as e:\n    print(f\"Error building transaction: {e}\")","lang":"python","description":"Generates a key pair, derives an address, and attempts to build a simple transaction using Blockfrost.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}