Run-DynamoDBLocal
AWS makes DynamoDBLocal -- a service that mirrors the API of DynamoDB and runs locally -- available to their customers for testing purposes. This Python packages facilitates running that service as a subprocess of the testing harness.
Install
$ pip install 'run-dynamodblocal[boto3]'
Leave off the [boto3] if you don't intend to use this package's ability to patch boto3.
Usage
Quickstart
With thanks to ncoghlan:
import boto3_mocking
from contextlib import ExitStack
import os.path
import run_dynamodblocal
import unittest
# If patching isn't engaged when the run_dynamodblocal context is entered, an
# exception will be thrown
boto3_mocking.engage_patching()
class MyTest(unittest.TestCase):
def setUp(self):
with ExitStack() as resources:
dynamodblocal_path = os.path.expanduser(
# wherever you keep the unpacked service binaries
'~/Downloads/dynamodb_local_latest'
)
resources.enter_context(
run_dynamodblocal.rddbl.patched_into_boto3(dynamodblocal_path)
)
# Enter any other contexts for this test class...
addCleanup(resources.pop_all().close)
# Define test methods here
Diving Deeper
This package provides two different context managers which run the DynamoDBLocal service -- one of which integrates with boto3 to automatically redirect the dynamodb service to this DynamoDBLocal instance. The DynamoDBLocal started will use the -inMemory flag, so it does not persist on disk after the test run is over and doesn't waste testing time committing information to disk.
| Context Manager | Description |
|---|---|
run_dynamodblocal.in_subprocess |
The most fundamental; runs the server and returns the port number as the context value |
run_dynamodblocal.patched_into_boto3 |
Runs the server and patches it into the boto3 library |
It also provides the run_dynamodblocal.LocalDbOps class, which supports refreshing the database schema and populated data based on a Serverless configuration and some basic JSON-type data.
Contributing
- Fork it on GitHub (https://github.com/rtweeks/run-dynamodblocal)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request (on GitHub)
Metadata
Release files for run-dynamodblocal 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| run-dynamodblocal-0.2.0.tar.gz | 9.5 kB | Without provenance | Details for run-dynamodblocal-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| run_dynamodblocal-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for run_dynamodblocal-0.2.0-py3-none-any.whl |
Total release size: 19.5 kB
Release files / run-dynamodblocal-0.2.0.tar.gz
| Download URL | run-dynamodblocal-0.2.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e3a6fc888ddb59396704bc09b04d9f0ffa300e76f80adc43550a32b489ac0a5
|
|
BLAKE2b-256 checksum How to use checksums |
aede8ed4514233852e79aa684a1acf2b95298f463459924d738416e948dbf3f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.9
|
Release files / run_dynamodblocal-0.2.0-py3-none-any.whl
| Download URL | run_dynamodblocal-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9913ed8965b1712f87430ec62476a23bc58db0ce9993878fd30ebf22745408d
|
|
BLAKE2b-256 checksum How to use checksums |
646d9327fa96e4497ac1c97f98ac490efc44e53cb517fba8849cad0d622eaae7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.9
|
Security for run-dynamodblocal 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.