Daml Python bindings (formerly known as dazl)
=============================================
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/digital-asset/dazl-client/blob/main/LICENSE)
<a href="https://circleci.com/gh/digital-asset/dazl-client">
<img src="https://circleci.com/gh/digital-asset/dazl-client.svg?style=svg">
</a>
Copyright (c) 2017-2024 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](https://digital-asset.github.io/dazl-client).
Installation
------------
If you just want to use the library, you can install it locally with `pip`:
```sh
pip install --user dazl
```
Requirements
------------
* Python 3.6+
* [Daml Connect](https://www.daml.com)
* Python gRPC libraries (1.32.0 or later) and Protobuf
**WARNING:** The next major version of dazl (v8.0.0) will require **Python 3.8** 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:
```py
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)
# Python 3.7+
asyncio.run(main())
# Python 3.6+
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```
Connect to the ledger as a single party, print all contracts, and close:
```py
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)
# Python 3.7+
asyncio.run(main())
# Python 3.6+
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```
Building locally
----------------
You will need additional dependencies to build locally:
* GNU Make 4.3 or later
* [Poetry](https://python-poetry.org/) for build/dependency management
Once you have these prerequisites in place:
```sh
make build
```
If you see errors about incompatible python versions, switch your environment to python3 using `poetry env use python3`, for instance.
Tests
-----
Tests in the Daml Python bindings are written using [pytest](https://docs.pytest.org/en/latest/). You can run them by doing:
```sh
make test
```
Support
-------
The Daml Python bindings library is 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](https://discuss.daml.com).
Raw data
{
"_id": null,
"home_page": "https://github.com/digital-asset/dazl-client",
"name": "dazl",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.7",
"maintainer_email": null,
"keywords": "daml, blockchain, dlt, distributed ledger, digital asset",
"author": "Davin K. Tanabe",
"author_email": "davin.tanabe@digitalasset.com",
"download_url": "https://files.pythonhosted.org/packages/ad/e2/8f75af3b8dc5b389f11f1bed260142e664e03a333453f1d0d5464af3c4d0/dazl-7.12.0.tar.gz",
"platform": null,
"description": "Daml Python bindings (formerly known as dazl)\n=============================================\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/digital-asset/dazl-client/blob/main/LICENSE)\n<a href=\"https://circleci.com/gh/digital-asset/dazl-client\">\n<img src=\"https://circleci.com/gh/digital-asset/dazl-client.svg?style=svg\">\n</a>\n\nCopyright (c) 2017-2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: Apache-2.0\n\n\nRich Python bindings for accessing Ledger API-based applications.\n\nDocumentation\n-------------\nThe user documentation is available online [here](https://digital-asset.github.io/dazl-client).\n\nInstallation\n------------\nIf you just want to use the library, you can install it locally with `pip`:\n```sh\npip install --user dazl\n```\n\nRequirements\n------------\n* Python 3.6+\n* [Daml Connect](https://www.daml.com)\n* Python gRPC libraries (1.32.0 or later) and Protobuf\n\n**WARNING:** The next major version of dazl (v8.0.0) will require **Python 3.8** or later.\n\nExamples\n--------\n\nAll of the examples below assume you imported `dazl`, and are running a ledger with the default scenario generated with `daml new`.\n\nConnect to the ledger and submit a single command:\n\n```py\nimport asyncio\nimport dazl\n\nasync def main():\n async with dazl.connect(url='http://localhost:6865', act_as='Alice') as client:\n contract = { 'issuer' : 'Alice', 'owner' : 'Alice', 'name' : 'hello world!' }\n await client.create('Main:Asset', contract)\n\n# Python 3.7+\nasyncio.run(main())\n\n# Python 3.6+\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\n```\n\nConnect to the ledger as a single party, print all contracts, and close:\n\n```py\nimport asyncio\nimport dazl\nfrom dazl.ledgerutil import ACS\n\nasync def main():\n async with dazl.connect(url='http://localhost:6865', read_as='Alice') as conn:\n async with ACS(conn, {\"*\": {}}) as acs:\n snapshot = await acs.read()\n\n print(snapshot)\n\n# Python 3.7+\nasyncio.run(main())\n\n# Python 3.6+\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\n```\n\nBuilding locally\n----------------\n\nYou will need additional dependencies to build locally:\n\n* GNU Make 4.3 or later\n* [Poetry](https://python-poetry.org/) for build/dependency management\n\nOnce you have these prerequisites in place:\n\n```sh\nmake build\n```\n\nIf you see errors about incompatible python versions, switch your environment to python3 using `poetry env use python3`, for instance.\n\nTests\n-----\n\nTests in the Daml Python bindings are written using [pytest](https://docs.pytest.org/en/latest/). You can run them by doing:\n\n```sh\nmake test\n```\n\nSupport\n-------\n\nThe Daml Python bindings library is 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](https://discuss.daml.com).\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "high-level Ledger API client for Daml ledgers",
"version": "7.12.0",
"project_urls": {
"Homepage": "https://github.com/digital-asset/dazl-client",
"Repository": "https://github.com/digital-asset/dazl-client"
},
"split_keywords": [
"daml",
" blockchain",
" dlt",
" distributed ledger",
" digital asset"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "35d8d88beb3596bae9919c14be091a3365feb716a47f21d4c16b5de97a540cb8",
"md5": "bde8652ca4106b52e38976981f9a87d0",
"sha256": "5a70d85617d68c99ce34d66df3bf711e740197fbf25ffe93114e9a11c892bcfd"
},
"downloads": -1,
"filename": "dazl-7.12.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bde8652ca4106b52e38976981f9a87d0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 898041,
"upload_time": "2024-07-11T23:44:19",
"upload_time_iso_8601": "2024-07-11T23:44:19.444525Z",
"url": "https://files.pythonhosted.org/packages/35/d8/d88beb3596bae9919c14be091a3365feb716a47f21d4c16b5de97a540cb8/dazl-7.12.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ade28f75af3b8dc5b389f11f1bed260142e664e03a333453f1d0d5464af3c4d0",
"md5": "f7c0d9dedc3fc8858e9935415655305d",
"sha256": "7db7a62da3a1d4f1c1bd0026332d3a2568273aa772fe42c1c80661e14f208717"
},
"downloads": -1,
"filename": "dazl-7.12.0.tar.gz",
"has_sig": false,
"md5_digest": "f7c0d9dedc3fc8858e9935415655305d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 538165,
"upload_time": "2024-07-11T23:44:22",
"upload_time_iso_8601": "2024-07-11T23:44:22.548432Z",
"url": "https://files.pythonhosted.org/packages/ad/e2/8f75af3b8dc5b389f11f1bed260142e664e03a333453f1d0d5464af3c4d0/dazl-7.12.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-11 23:44:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "digital-asset",
"github_project": "dazl-client",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"lcname": "dazl"
}