A intelligent DynamoDB frontend for Python3
import boto3 # require to build a client
import byrne
session = boto3.Session()
base_client = session.client("dynamodb")
client = byrne.DynamoDB(base_client)
client.list_tables() # ["table", "names"]
table_def = byrne.datastructures.TableDefinition(
"TableName",
{
"id": "S"
},
byrne.datastructures.KeyDefinition("id")
)
client.create_table(table_def)
-
How do I install
byrne
?- Simply run
pip3 install byrne
- the PyPI package is automatically kept up to date with this repository.
- Simply run
-
Why does this require Python 3.7?
- We use dataclasses heavily to model table metadata and to simplify query expressions.
-
Why is this better than using the default client in
boto3
?- Support for asyncronous result pagination.
- Allows for integrated object mapping.
- Configurable value marshalling and unmarshalling.
- A more Pythonic interface.
- Builtin support for working with DAX.
-
How is the package tested?
- The testing regimen is automated through
tox
. - Tests are run against a DynamoDB Local instance for all supported Python versions.
- The tests are run against the live DynamoDB service in AWS us-east-1 for the latest Python version.
- Code coverage is tracked through Coveralls.
- The testing regimen is automated through
-
Why is the DAX code path untested?
- We are working on creating a testing strategy for DAX workflows.
- DAX is expensive, we can't justify having a dedicated cluster running only for testing.
-
I can't run the test cases on my local machine! Help!
- There are 5 test environments defined in
tox.ini
:test
: Runs test suite against "real" DynamoDB.test_local
: Runs test suite against DynamoDB Local.test_coverage
: Same astest
, with coverage reporting.test_coverage_local
: Same astest_local
, with coverage reporting.flake8
: Runs PEP8 conformance testing.
- The live test cases require AWS credentials on your machine.
- These credentials need access rights to assume a role used for testing.
- Access to this role is only granted to trusted contributors.
- You should be able to run the local environments after executing the
run_dynamodb_local.sh
script. flake8
should run without any fuss.
- There are 5 test environments defined in