py-data-api - Data API Client for Python
py-data-api is a client for Data API of Aurora Serverless. Also, the package includes SQLAlchemy Dialects and DB API 2.0 Client.
Features
- SQLAlchemy Dialects
- DB API 2.0 compatible client PEP 249
Support Database Engines
- MySQL
- PostgreSQL
What's AWS Aurora Serverless's Data API?
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html
This project is an experimental phase.
Warning: Some interface will be changed.
How to install
pydataapi requires Python 3.6.1 or later
$ pip install pydataapi
Example
from typing import List
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from pydataapi import DataAPI, Result
class Pets(declarative_base()):
__tablename__ = 'pets'
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String(255, collation='utf8_unicode_ci'), default=None)
database: str = 'test'
resource_arn: str = 'arn:aws:rds:us-east-1:123456789012:cluster:serverless-test-1'
secret_arn: str = 'arn:aws:secretsmanager:us-east-1:123456789012:secret:serverless-test1'
def example_driver_for_sqlalchemy():
from sqlalchemy.engine import create_engine
engine = create_engine(
'mysql+pydataapi://',
connect_args={
'resource_arn': 'arn:aws:rds:us-east-1:123456789012:cluster:dummy',
'secret_arn': 'arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy',
'database': 'test'}
)
result = engine.execute("select * from pets")
print(result.fetchall())
def example_simple_execute():
data_api = DataAPI(resource_arn=resource_arn, secret_arn=secret_arn, database=database)
result: Result = data_api.execute('show tables')
print(result.scalar())
# Pets
Contributing to pydataapi
We are waiting for your contributions to pydataapi.
How to contribute
https://koxudaxi.github.io/py-data-api/contributing
Related projects
local-data-api
DataAPI Server for local
https://github.com/koxudaxi/local-data-api
PyPi
https://pypi.org/project/pydataapi
Source Code
https://github.com/koxudaxi/py-data-api
Documentation
https://koxudaxi.github.io/py-data-api
License
py-data-api is released under the MIT License. http://www.opensource.org/licenses/mit-license
Metadata
Release files for pydataapi 0.4.24
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pydataapi-0.4.24.tar.gz | 27.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydataapi-0.4.24-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.9 kB
Release files / pydataapi-0.4.24.tar.gz
| Download URL | pydataapi-0.4.24.tar.gz |
|---|---|
| Size | 27.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f048d8fcbaa2c4d791f02b78887f9f884e2f31d2965e119acec97ba490114d6d
|
|
BLAKE2b-256 checksum How to use checksums |
022eb9498c416f02824739a42edb86af5658d1e9748e6701949c62f02e9b90b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / pydataapi-0.4.24-py3-none-any.whl
| Download URL | pydataapi-0.4.24-py3-none-any.whl |
|---|---|
| Size | 26.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4d122db2e0977ea66a7f23b3b446ab9d629157172b6c234649bc07d4d80f64a
|
|
BLAKE2b-256 checksum How to use checksums |
aadfc696ae6f92cf9cd133bc5ceb1c9f18fee6b5ba96513e72261597b85e7ff5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|