Skip to main content

high-level Ledger API client for Daml ledgers

Project description

Daml Python bindings (formerly known as dazl)

License

Copyright (c) 2017-2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Rich Python bindings for accessing Ledger API-based applications.

Documentation

The user documentation is available online here.

Installation

If you just want to use the library, you can install it locally with pip:

pip install --user dazl

Requirements

  • Python 3.10+
  • Go 1.23
  • Daml SDK
    • Daml 2: 2.10 or later

Examples

All of the examples below assume you imported dazl, and are running a ledger with the default scenario generated with daml new.

Connect to the ledger and submit a single command:

import asyncio
import dazl

async def main():
    async with dazl.connect(url='http://localhost:6865', act_as='Alice') as client:
        contract = { 'issuer' : 'Alice', 'owner' : 'Alice', 'name' : 'hello world!' }
        await client.create('Main:Asset', contract)

asyncio.run(main())

Connect to the ledger as a single party, print all contracts, and close:

import asyncio
import dazl
from dazl.ledgerutil import ACS

async def main():
    async with dazl.connect(url='http://localhost:6865', read_as='Alice') as conn:
        async with ACS(conn, {"*": {}}) as acs:
            snapshot = await acs.read()

    print(snapshot)

asyncio.run(main())

Building locally

You will need additional dependencies to build locally:

Once you have these prerequisites in place:

make build

Tests

Tests in the Daml Python bindings are written using pytest. You can run them by doing:

make test

Support

The Daml Python bindings library are supported under the Daml Enterprise license. If you do not have a Daml Enterprise license and are in need of support, have questions or just want to engage in friendly conversation anything Daml, contact us on our Daml Community Forum.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dazl-8.4.1.tar.gz (640.9 kB view details)

Uploaded Source

Built Distribution

dazl-8.4.1-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file dazl-8.4.1.tar.gz.

File metadata

  • Download URL: dazl-8.4.1.tar.gz
  • Upload date:
  • Size: 640.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.10 Darwin/24.5.0

File hashes

Hashes for dazl-8.4.1.tar.gz
Algorithm Hash digest
SHA256 2f8d0021a9e83f2cb65146cc24c30894c4f7bff6e6398d5f399896ec66b892c6
MD5 c26c1517d1bd2c14d81cfe88886ba162
BLAKE2b-256 a87e5f078518381d1f1bdb67111053558777dcd0f7daf7d87cd4e609bc83abde

See more details on using hashes here.

File details

Details for the file dazl-8.4.1-py3-none-any.whl.

File metadata

  • Download URL: dazl-8.4.1-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.10 Darwin/24.5.0

File hashes

Hashes for dazl-8.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c3efd2d0990796cc6ca144f40c925e9e5da3c0e0bd3dc05a4a0e5287429e9b7
MD5 4eedca251244948959765e9becd8e836
BLAKE2b-256 56426eceecb47e1f44ae427b18ef5d3e74f1a4d08112747c7d8a465dac6fd171

See more details on using hashes here.

Supported by

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