r/Python • u/antoniorodriguez-dev • Mar 05 '26
Showcase I built dkmio – a minimal Object-Key Mapper for DynamoDB to reduce boto3 boilerplate
Hi everyone,
I’ve been working with DynamoDB + boto3 for a while, and I kept running into repetitive patterns: building ExpressionAttributeNames, crafting update expressions, and handling pagination loops manually.
So I built dkmio, a small Object-Key Mapper (OKM) focused on reducing boilerplate while keeping DynamoDB semantics explicit.
GitHub: https://github.com/Antonipo/dkmio
PyPI: https://pypi.org/project/dkmio/
Docs: https://dkmio.antoniorodriguez.dev/
What My Project Does
dkmio is a thin, typed wrapper around boto3 that automates the tedious parts of DynamoDB interaction. It reduces code volume by:
Automatically generating update and filter expressions.
Safely handling reserved attribute names (no more manual aliasing).
Auto-paginating queries and auto-chunking batch writes.
Converting DynamoDB
Decimalvalues into JSON-serializable types.
It supports native operations (get, query, scan, update, transactions) without introducing heavy abstractions, hidden state tracking, or implicit scans.
Target Audience
This tool is meant for:
Backend developers using Flask, FastAPI, or AWS Lambda.
Teams building production services who want to avoid the verbosity of raw boto3 but dislike heavy ORMs.
Developers who prefer explicit NoSQL modeling over "magic" abstraction layers.
Comparison
Vs. Raw boto3 Standard boto3 requires verbose setup for simple updates:
# Raw boto3
table.update_item(
Key={"PK": pk, "SK": sk},
UpdateExpression="SET #revoked = :val0",
ExpressionAttributeNames={"#revoked": "revoked_at"},
ExpressionAttributeValues={":val0": now_epoch()}
)With dkmio, this is simplified to:
# dkmio
users.update(PK=pk, SK=sk, set={"revoked_at": now_epoch()})Vs. PynamoDB / ORMs Unlike PynamoDB, dkmio does not enforce schemas, has no model state tracking, and doesn't hide database behavior. It acts as a productivity layer rather than a full abstraction framework, keeping the developer in control of the actual DynamoDB logic.
Feedback is greatly appreciated