dazl


Namedazl JSON
Version 7.11.0 PyPI version JSON
download
home_pagehttps://github.com/digital-asset/dazl-client
Summaryhigh-level Ledger API client for Daml ledgers
upload_time2023-05-02 00:14:27
maintainer
docs_urlNone
authorDavin K. Tanabe
requires_python>=3.6.2,<4.0.0
licenseApache-2.0
keywords daml blockchain dlt distributed ledger digital asset
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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-2023 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": "",
    "docs_url": null,
    "requires_python": ">=3.6.2,<4.0.0",
    "maintainer_email": "",
    "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/df/1d/32a69bf1d5b8a412464a84c62434c9a7e28285be8ed8c73d546f9c03a083/dazl-7.11.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-2023 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.11.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": "96f231b4f9172b63052d17453bb78d0680b2088202be040edbf2b64a64c75b75",
                "md5": "a7c89aa1ee704cd40af612f6fb0e8a96",
                "sha256": "2f3c0f3c73b15b91da8d6f289c5898ad80c82d12e89634db559e8af1b1e373cc"
            },
            "downloads": -1,
            "filename": "dazl-7.11.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a7c89aa1ee704cd40af612f6fb0e8a96",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6.2,<4.0.0",
            "size": 518679,
            "upload_time": "2023-05-02T00:14:25",
            "upload_time_iso_8601": "2023-05-02T00:14:25.178967Z",
            "url": "https://files.pythonhosted.org/packages/96/f2/31b4f9172b63052d17453bb78d0680b2088202be040edbf2b64a64c75b75/dazl-7.11.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "df1d32a69bf1d5b8a412464a84c62434c9a7e28285be8ed8c73d546f9c03a083",
                "md5": "71b2179e45ceb8d8d0be7c2334bdf146",
                "sha256": "204af29bf15df06ef934e6bec4ec95f3b50d984681df55cfbe0f0658248fee4f"
            },
            "downloads": -1,
            "filename": "dazl-7.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "71b2179e45ceb8d8d0be7c2334bdf146",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6.2,<4.0.0",
            "size": 359339,
            "upload_time": "2023-05-02T00:14:27",
            "upload_time_iso_8601": "2023-05-02T00:14:27.228314Z",
            "url": "https://files.pythonhosted.org/packages/df/1d/32a69bf1d5b8a412464a84c62434c9a7e28285be8ed8c73d546f9c03a083/dazl-7.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-02 00:14:27",
    "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"
}
        
Elapsed time: 0.23217s