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.3.tar.gz (100.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.3-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dynamodx-0.1.3.tar.gz
  • Upload date:
  • Size: 100.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for dynamodx-0.1.3.tar.gz
Algorithm Hash digest
SHA256 de000368b71a4cd34058d38f01f7b6a93b0b90291fa96e6fd711eb7878c13683
MD5 79030b5bf4b5b955f9b69fc2410579f9
BLAKE2b-256 4162e8afc1157b09850f121ef4d50e3235c01583256fffffe6e75b6ed18d1e62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dynamodx-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for dynamodx-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 195d414b23f1d636d93439951d6468c84f68139cf8dd10deb8412a7aea8c3b37
MD5 95927b9c74c8ec423fd7a15ce3aacc92
BLAKE2b-256 01d2d44e12cdd4b8223605b0372f90070c8b9d899e1e512e882a10671ba25bd5

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