Dynamixe
A developer-friendly library for DynamoDB that simplifies single-table design without ORM lock-in.
Features
- Expression-based API - SQLAlchemy-style attribute access for type-safe queries
- Model configuration - Pydantic-compatible
model_configpattern - No ORM lock-in - Works with Pydantic, dataclasses, or plain dicts
- Transactional operations - Full support for transact_get and transact_write
- Conditional operations - Expression-based conditions with custom exceptions
- JMESPath transformations - Transform transactional results with powerful queries
Installation
pip install dynamixe
Quick Start
Define a Model
from dynamixe import Model, ConfigDict
class User(Model):
model_config = ConfigDict(
table='users',
partition_key='id',
sort_key='sk',
)
id: str
sk: str
name: str
Use Expressions
# SQLAlchemy-style expression access
User.id == 'USER#10' # Equality
User.sk.not_exists() # Condition
User.name.begins_with('A') # Begins with
User.sk.between('0', '100') # Range
# Combine expressions
(User.id == 'USER#10') & (User.sk == '0')
Conditional Put
from dynamixe import DynamoDBClient
client = DynamoDBClient(table_name='users')
# Put with condition using expressions
client.put_item(
user,
cond_expr=User.sk.not_exists(),
)
Query Items
# Query with key condition expression
result = client.query(
User.id == 'USER#10',
scan_index_forward=True,
limit=10,
)
# Access results as dict
items = result['items']
count = result['count']
last_key = result['last_key'] # For pagination
# Transform with JMESPath
names = result.jmespath('[*].name')
# ['Alice', 'Bob', 'Charlie']
Transactional Writes
from dynamixe import TransactWriter, TransactionOperationFailed
class EmailConflictError(TransactionOperationFailed):
pass
with TransactWriter('users', client=boto3_client) as tx:
tx.put(
item={'id': 'USER#1', 'sk': '0', 'name': 'Alice'},
cond_expr=User.sk.not_exists(),
exc_cls=EmailConflictError,
)
# Or via client
with client.transact_writer() as tx:
...
Transactional Reads
from dynamixe import TransactGet, get
tx = TransactGet('users', client=boto3_client)
result = tx.get_items(
get({'id': 'USER#1', 'sk': '0'}),
get({'id': 'USER#2', 'sk': '0'}).project(User.name, User.email),
)
# Or via client
tx = client.transact_get()
result = tx.get_items(...)
JMESPath Transformations
Transform transactional results with JMESPath expressions:
from dynamixe import TransactGet, get
tx = client.transact_get()
names = tx.get_items(
get({'id': 'USER#1', 'sk': '0'}),
get({'id': 'USER#2', 'sk': '0'}),
).jmespath('[*].name')
# ['Alice', 'Bob']
The TransactGetResult wrapper supports list-like operations:
result = tx.get_items(get({'id': 'USER#1', 'sk': '0'}))
len(result) # 1
result[0] # {'id': 'USER#1', ...}
for item in results:
print(item['name'])
Works with Any Model Pattern
Pydantic:
from pydantic import BaseModel
class User(BaseModel):
model_config = ConfigDict(table='users', partition_key='id')
id: str
name: str
Dataclass (via __dynamodb_config__):
from dataclasses import dataclass
@dataclass
class User(Model):
__dynamodb_config__ = ConfigDict(
table='users',
partition_key='id',
sort_key='sk',
)
id: str
sk: str
name: str
Plain dict:
# No model needed
client.put_item({'id': 'USER#1', 'sk': '0', 'name': 'Alice'})
API Reference
DynamoDBClient
get_item(key, ...)- Get single itemput_item(item, cond_expr=..., exc_cls=...)- Put with conditionupdate_item(key, update_expr, ...)- Update itemdelete_item(key, cond_expr=...)- Delete itemquery(key_expr, ...)- Query items by key conditionscan(filter_expr=...)- Scan all items with optional filtertransact_get()- Start transactional readtransact_writer(flush_amount=50)- Start transactional write
Model
model_config- Class attribute for DynamoDB configurationget_table()- Get table nameget_partition_key()- Get partition key attributeget_sort_key()- Get sort key attribute
ConfigDict
ConfigDict(
table='table-name',
partition_key='pk',
sort_key='sk', # optional
)
Expressions
- Comparison:
==,!=,<,<=,>,>= - Conditions:
not_exists(),exists(),begins_with(),between() - Logical:
&(AND),|(OR),~(NOT)
TransactGetResult
jmespath(expr)- Apply JMESPath expression to transform results__len__()- Support forlen()__getitem__(index)- Support for indexing__iter__()- Support for iteration
Why Dynamixe?
- No ORM lock-in - Use Pydantic, dataclasses, or plain dicts
- Type-safe - Full type hints for IDE autocomplete
- Single-table design - Built for DynamoDB best practices
- Expression API - Composable, testable, readable
- Transactional - ACID operations with custom exceptions
- JMESPath support - Powerful result transformations
License
MIT
Metadata
Release files for dynamixe 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dynamixe-0.1.0.tar.gz | 69.9 kB | With provenance | Details for dynamixe-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dynamixe-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for dynamixe-0.1.0-py3-none-any.whl |
Total release size: 83.8 kB
Release files / dynamixe-0.1.0.tar.gz
| Download URL | dynamixe-0.1.0.tar.gz |
|---|---|
| Size | 69.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6f4f96d55b4a111dd297aafe9361717aefff11e5732c7e77766e1c42f9fb225
|
|
BLAKE2b-256 checksum How to use checksums |
dd91c07b2b94db8e2197ff7a377b35467f9b8eb6d8782e51335b8001e25c6431
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.
Transparency logRelease files / dynamixe-0.1.0-py3-none-any.whl
| Download URL | dynamixe-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d86d3b272787799e54d43281ff1d5ba8d6a7d8f21ac2441d1508f8bc84483a9
|
|
BLAKE2b-256 checksum How to use checksums |
69f1d4b4ccafbe5fa98bb2a485ca754eaa0ab8946bd051a6e8e48477b2506547
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.
Transparency logSecurity for dynamixe 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for dynamixe-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.