Python utilities for day-to-day development — type safety, async helpers, database abstractions, retry executors, data structures, and DX tools in one MIT-licensed package.
Requires Python 3.11+.
Common scripting and library work often re-implements the same helpers. danielutils packages the ones used across projects so you can validate types at runtime, talk to several DB backends behind one API, retry flaky calls, and ship progress/logging/reflection utilities without reinventing them.
- Type safety —
isoftype,@validate,@overload, typed collections (tlist, …) - Async — worker pools and async utilities
- Database abstractions — SQLite, Redis, and in-memory backends via one factory
- Retry — configurable executors with backoff strategies
- Data structures & algorithms — graphs, heaps, and related helpers
- DX — progress bars, logging, reflection, debugging aids
- Academic — probability / statistics helpers under
university
pip install danielutils
# or
uv add danielutilsfrom danielutils import isoftype, validate, tlist
from danielutils.abstractions.db import DatabaseFactory
from danielutils.abstractions.db.database_definitions import TableSchema, TableColumn, ColumnType
numbers = tlist[int]([1, 2, 3, 4, 5])
@validate
def greet(name: str, age: int) -> str:
return f"Hello {name}, you are {age} years old"
db = DatabaseFactory.get_database("memory")
with db:
schema = TableSchema(
name="users",
columns=[
TableColumn(name="id", type=ColumnType.AUTOINCREMENT, primary_key=True),
TableColumn(name="name", type=ColumnType.TEXT, nullable=False),
TableColumn(name="age", type=ColumnType.INTEGER),
],
)
db.create_table(schema)
db.insert("users", {"name": "Alice", "age": 30})
if isoftype(numbers, list[int]):
print("Numbers is a list of integers!")Deep dives live under READMES/:
| Topic | Doc |
|---|---|
| Runtime type checks | isoftype |
| Function overloading | @overload |
| Argument validation | @validate |
| Typed lists | tlist |
| Interfaces | Interface |
| DB abstraction | database_abstraction |
| Retry | retry_executor |
| Progress bars | progress_bar |
| Async workers | async_worker_pool |
| Singleton | singleton |
Agent/developer workflow (uv, tests, CI/CD labels, secrets, __version__): see AGENTS.md.
Report security issues privately via GitHub advisories — please do not open a public issue for vulnerabilities.
MIT — see LICENSE.