Skip to main content

Amazon QLDB Python Driver

This is the Python driver for Amazon Quantum Ledger Database (QLDB), which allows Python developers to write software that makes use of AmazonQLDB.

Documentation Status

For our tutorial, see Python and Amazon QLDB.

Requirements

Basic Configuration

See Accessing Amazon QLDB for information on connecting to AWS.

Python 3.4 or later

The driver requires Python 3.4 or later. Please see the link below for more detail to install Python:

Getting Started

First, install the driver using pip:

pip install pyqldb

Then from a Python interpreter, call the driver and specify the ledger name:

from pyqldb.driver.pooled_qldb_driver import PooledQldbDriver

qldb_driver = PooledQldbDriver(ledger_name='test-ledger')
qldb_session = qldb_driver.get_session()

for table in qldb_session.list_tables():
    print(table)

See Also

  1. Getting Started with Amazon QLDB Python Driver A guide that gets you started with executing transactions with the QLDB Python driver.
  2. QLDB Python Driver Cookbook The cookbook provides code samples for some simple QLDB Python driver use cases.
  3. Amazon QLDB Python Driver Tutorial: In this tutorial, you use the QLDB Driver for Python to create an Amazon QLDB ledger and populate it with tables and sample data.
  4. Amazon QLDB Python Driver Samples: A DMV based example application which demonstrates how to use QLDB with the QLDB Driver for Python.
  5. QLDB Python driver accepts and returns Amazon ION Documents. Amazon Ion is a richly-typed, self-describing, hierarchical data serialization format offering interchangeable binary and text representations. For more information read the ION docs.
  6. Amazon QLDB supports the PartiQL query language. PartiQL provides SQL-compatible query access across multiple data stores containing structured data, semistructured data, and nested data. For more information read the PartiQL docs.
  7. Refer the section Common Errors while using the Amazon QLDB Drivers which describes runtime errors that can be thrown by the Amazon QLDB Driver when calling the qldb-session APIs.

Development

Setup

Assuming that you have Python and virtualenv installed, set up your environment and installed the dependencies like this instead of the pip install pyqldb defined above:

$ git clone https://github.com/awslabs/amazon-qldb-driver-python
$ cd amazon-qldb-driver-python
$ virtualenv venv
...
$ . venv/bin/activate
$ pip install -r requirements.txt
$ pip install -e .

Running Tests

You can run the unit tests with this command:

$ pytest --cov-report term-missing --cov=pyqldb

Documentation

Sphinx is used for documentation. You can generate HTML locally with the following:

$ pip install -r requirements-docs.txt
$ pip install -e .
$ cd docs
$ make html

License

This library is licensed under the Apache 2.0 License.

Release files for pyqldb 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyqldb 2.0.2
File Size Uploaded
pyqldb-2.0.2.tar.gz 18.7 kB Details

Release files / pyqldb-2.0.2.tar.gz

Download URL pyqldb-2.0.2.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5e4f416f08c42a4280422363cfc9f4a2710488894b19101f34a4b0a54738922e
BLAKE2b-256 checksum
How to use checksums
9607999f0e8ad68af118c9e90c0e70c7c7e3e24706dedccf85dfe0345e720b83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

Release history Release notifications | RSS feed

3.2.4

1 release file

3.2.3

1 release file

3.2.2

2 release files

3.2.1

2 release files

3.2.0

1 release file

3.1.0

1 release file

3.0.0

1 release file

This release

2.0.2 This release

1 release file

2.0.1

1 release file

2.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page