Skip to main content

Developer-friendly library for DynamoDB with single-table design, without ORM lock-in.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Dynamodx

A developer-friendly library for DynamoDB, simplifying single-table design without ORM lock-in.

from dynamodx.transact_writer import TransactWriter, TransactionOperationFailed

class EmailConflictError(TransactionOperationFailed):
    pass

try:
    with TransactWriter(table_name=..., client=...) as transact:
        transact.put(
            item={
                'pk': user_id,
                'sk': '0',
                'name': name,
                'email': email,
                'phone': phone,
            }
        )
        transact.put(
            item={
                'pk': f'EMAIL',
                'sk': email,
                'user_id': user_id,
            },
            cond_expr='attribute_not_exists(sk)',
            return_on_cond_fail='ALL_OLD',
            exc_cls=EmailConflictError,
        )
except EmailConflictError as err:
    # Got existing `user_id`
    user_id = err.reason['old_image']['user_id']

License

Dynamodx is open-source software licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynamodx-0.1.0.tar.gz (94.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynamodx-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file dynamodx-0.1.0.tar.gz.

File metadata

  • Download URL: dynamodx-0.1.0.tar.gz
  • Upload date:
  • Size: 94.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dynamodx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8843e4944f1bda9a6bf212cf84120370a0f669ed89abba3639d21b6569936da2
MD5 ec1ac1e213db5390db44b4bd596b5fce
BLAKE2b-256 45fcaa3dd0a5bc538c1fdc096bbeca73f1a59053b414d93c1707d0ca19134dc6

See more details on using hashes here.

File details

Details for the file dynamodx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dynamodx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dynamodx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b46b2df76e9e02cebcfea81c37f66324bd33e48c1e713040d84af57fc30359e
MD5 0986a79687344d57148b7b91f15afdbb
BLAKE2b-256 89ef11114a0e02801c14de257534358699e7e41c8f062831c5bbb73943182545

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page