Skip to main content

danielutils

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.

CI PyPI Python License: MIT

Requires Python 3.8+.

Why danielutils?

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

Install

pip install danielutils
# or
uv add danielutils

Quick start

from 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!")

Docs by feature

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

Contributing & development

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.

License

MIT — see LICENSE.

Metadata

Release files for danielutils 1.1.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for danielutils 1.1.30
File Interpreter ABI Platform Actions
danielutils-1.1.30-py3-none-any.whl Python 3 none any Details for danielutils-1.1.30-py3-none-any.whl

Release files / danielutils-1.1.30-py3-none-any.whl

Download URL danielutils-1.1.30-py3-none-any.whl
Size 276.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1bd273c53e885037d35fc42b8f1de733571f5976f04946d27b6671408ff18c6
BLAKE2b-256 checksum
How to use checksums
62aa58e577cdeda6b291db2e8bb58dfaa79fb78e21b9a33be9c1b1685fb48d34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for danielutils 1.1.30

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

1.1.30 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page