Dyntastic is a Python library that provides an intuitive Object-Document Mapper (ODM) for Amazon DynamoDB, built on top of Pydantic for data validation and `boto3` for AWS interaction. It simplifies schema definition, data serialization, and common DynamoDB operations. The current version is 0.18.0, with minor releases occurring approximately every 1-2 months.
pip install dyntasticVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a DyntasticModel, save, retrieve, update, and delete items. It assumes DynamoDB is available at the configured region/host. The `__table_name__` and `__table_hash_key__` define the DynamoDB table structure. `table_create_args` in `Config` can be used to specify creation parameters like `BillingMode`.
Ensure `dyntastic>=0.13.1` is installed if your project uses `pydantic>=2.0`. Verify your Pydantic version with `pip show pydantic`.
Upgrade to `dyntastic>=0.11.0` if you rely on transactions not committing on error. Review existing transaction error handling in older versions.
Upgrade to `dyntastic>=0.17.0` to ensure correct handling of aliased keys in all operations, including deletion.
If using `dyntastic<0.14.0`, you must explicitly define `__table_region__` and `__table_host__` on your `DyntasticModel` classes, or configure `boto3` directly. For `dyntastic>=0.14.0`, setting the environment variables is an option.