Metadata-Version: 2.4
Name: dynamodx
Version: 0.1.1
Summary: Developer-friendly library for DynamoDB with single-table design, without ORM lock-in.
Project-URL: Homepage, https://github.com/sergiors/dynamodx
Project-URL: Repository, https://github.com/sergiors/dynamodx
Project-URL: Issues, https://github.com/sergiors/dynamodx/issues
Author-email: Sérgio Rafael Siqueira <osergiosiqueira@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: aws,database,dynamodb
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: boto3>=1.42.39
Requires-Dist: jmespath>=1.1.0
Description-Content-Type: text/markdown

## Dynamodx

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

```python
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](LICENSE).
