Skip to main content
# ddb-local

Python wrapper for DynamoDB Local.

## What is it for?

This is a convenient Python wrapper for [DynamoDB Local](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html). All the instructions online currently involves manually downloading the tarball and installing it, which is a huge hassle and is a barrier to automation. It wasn't really easy to integrate the local DDB nicely into tests (e.g., pytest) so I wrote this library.

## Prerequisite

You must have `java` in `PATH` or specify `JAVA_HOME`. You need a working Internet connection to download DynamoDBLocal tarball. Optionally, you can get it yourself, and point `unpack_dir` to the root of the unpacked directory.

## Examples

Get a throwaway in-memory DDB for testing:

```python
import boto3
from ddb_local import create_new_inmemory_ddb

with create_new_inmemory_ddb() as local_ddb:
ddb = boto3.client('dynamodb', endpoint_url=local_ddb.endpoint)
```

Use it in a context manager:

```python
import boto3
from ddb_local import LocalDynamoDB

with LocalDynamoDB() as local_ddb:
ddb = boto3.client('dynamodb', endpoint_url=local_ddb.endpoint)

```

Example usage with [pytest](https://pytest.org/):

```python
import pytest
from ddb_local import LocalDynamoDB

@pytest
def ddb():
with LocalDynamoDB():
yield ddb
```

## Development

* `make` to run test, coverage and distribution build.
* `make coverage` to run coverage.
* `make test` to run test.
* `pytest` to run test.
* `make clean` to delete all files.
* `make upload` to upload to PyPI.
* Populate `.pypirc` with the API token.

## Support

Support is provided on a best-effort basis.

Create an issue in the [Github repo](https://github.com/wbkang/ddb_local).

Release files for ddb-local 0.1.3

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

Source distribution (sdist)

Source distribution for ddb-local 0.1.3
File Size Uploaded
ddb_local-0.1.3.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ddb-local 0.1.3
File Interpreter ABI Platform
ddb_local-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / ddb_local-0.1.3.tar.gz

Download URL ddb_local-0.1.3.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6e94910714d78428cfcc56f57fd4867e89badf7b217c78108c979aca30852c10
BLAKE2b-256 checksum
How to use checksums
06cadfb2dcf5cd6bdeaf52f7a477c724a7d0fa87ee2385209dca31da8c3d25e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / ddb_local-0.1.3-py3-none-any.whl

Download URL ddb_local-0.1.3-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cabcd5d97cab0ae652e686c13a6d89184d2e153c03605dd2ce38583f9fd0b5f1
BLAKE2b-256 checksum
How to use checksums
8ae6b3324e11c3bf28e9d0d76b3708003d6e41f244daff92d1d6dbd65290471c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

This release

0.1.3 This release

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1

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