Installing the Amazon QLDB Python sample application - Amazon Quantum Ledger Database (Amazon QLDB)

Installing the Amazon QLDB Python sample application

This section describes how to install and run the provided Amazon QLDB sample application for the step-by-step Python tutorial. The use case for this sample application is a department of motor vehicles (DMV) database that tracks the complete historical information about vehicle registrations.

The DMV sample application for Python is open source in the GitHub repository aws-samples/amazon-qldb-dmv-sample-python.

Prerequisites

Before you get started, make sure that you complete the QLDB driver for Python Prerequisites. This includes installing Python and doing the following:

  1. Sign up for AWS.

  2. Create a user with the appropriate QLDB permissions.

  3. Grant programmatic access for development.

To complete all of the steps in this tutorial, you need full administrative access to your ledger resource through the QLDB API.

Installation

To install the sample application
  1. Enter the following pip command to clone and install the sample application from GitHub.

    3.x
    pip install git+https://github.com/aws-samples/amazon-qldb-dmv-sample-python.git
    2.x
    pip install git+https://github.com/aws-samples/amazon-qldb-dmv-sample-python.git@v1.0.0

    The sample application packages the complete source code from this tutorial and its dependencies, including the Python driver and the AWS SDK for Python (Boto3).

  2. Before you start running code at the command line, switch your current working directory to the location where the pyqldbsamples package is installed. Enter the following command.

    cd $(python -c "import pyqldbsamples; print(pyqldbsamples.__path__[0])")
  3. Proceed to Step 1: Create a new ledger to start the tutorial and create a ledger.