Skip to main content

A Python DB-API 2.0 client for the AWS Aurora Serverless Data API

Project description

# aurora-data-api - A Python DB-API 2.0 client for the AWS Aurora Serverless Data API

Installation

pip install aurora-data-api

Prerequisites

Usage

Use this module as you would use any DB-API compatible driver module. The aurora_data_api.connect() method is the standard main entry point, and accepts two implementation-specific keyword arguments:

  • aurora_cluster_arn (also referred to as resourceArn in the Data API documentation)
  • secret_arn (the database credentials secret)
import aurora_data_api

cluster_arn = "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-serverless-cluster"
secret_arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:MY_DB_CREDENTIALS"
with aurora_data_api.connect(aurora_cluster_arn=cluster_arn, secret_arn=secret_arn, database="my_db") as conn:
    with conn.cursor() as cursor:
        cursor.execute("select * from pg_catalog.pg_tables")
        print(cursor.fetchall())

Motivation

The RDS Data API is the missing link between the AWS Lambda serverless environment and the sophisticated features provided by PostgreSQL and MySQL. The Data API tunnels SQL over HTTP, eliminating the need to use a traditional database driver

License

Licensed under the terms of the Apache License, Version 2.0.

https://travis-ci.org/chanzuckerberg/aurora-data-api.png https://codecov.io/github/chanzuckerberg/aurora-data-api/coverage.svg?branch=master https://img.shields.io/pypi/v/aurora-data-api.svg https://img.shields.io/pypi/l/aurora-data-api.svg https://readthedocs.org/projects/aurora-data-api/badge/?version=latest

Project details


Download files

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

Files for aurora-data-api, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size aurora_data_api-0.0.1-py2.py3-none-any.whl (9.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size aurora-data-api-0.0.1.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page