Skip to main content

Build Status codecov

DynamoDB Ghost

DynamoDB Ghost is a small Python library providing the ability to create transient, metadata-preserving copies of DynamoDB tables on AWS.

Installation

As easy as pip.

pip install dynamodb-ghost

Usage

The main intention of DynamoDB Ghost is to be used as a testing aid in cases where we wish to apply a set of tests to an existing table without making modifications to the original (e.g. as part of setup)

Using pytests fixtures, a sample test such as:

import pytest
import boto3

@pytest.fixture
def my_table():
    return boto3.resource('dynamodb').Table('my_table')

def test_table(my_table):
    assert ...

insead becomes:

import pytest
import boto3
from dynamodb_ghost import ghost

@pytest.fixture
def my_table():
with ghost(boto3.client('dynamodb'), 'my_table') as ghost_table:
    yield boto3.resource('dynamodb').Table(ghost_table)

def test_table(my_table):
    assert ...

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for dynamodb-ghost 0.0.2

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

Source distribution (sdist)

Source distribution for dynamodb-ghost 0.0.2
File Size Uploaded
dynamodb_ghost-0.0.2.tar.gz 6.7 kB Details

Release files / dynamodb_ghost-0.0.2.tar.gz

Download URL dynamodb_ghost-0.0.2.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9a35552ef4abe36d967115e99a9c1e6bf01d0d93682ded8643c2e50e75d049a4
BLAKE2b-256 checksum
How to use checksums
24451b72d851a7d81817996dd9ff1f748903e06f926d72a3ed2ffe926cfea222
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.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