Skip to main content

dloader

A Python implementation of the DataLoader pattern for data fetching with automatic batching.

Features

  • Automatically batches and deduplicates concurrent loads
  • Caches results and allows custom in-memory caches
  • Manages asyncio tasks and allows proper cleanup
  • Small, focused and free of other dependencies
  • Fully typed and fully tested

Installation

uv add dloader
# or
pip install dloader

Documentation

You can find documentation at: https://oinopion.github.io/dloader

Quick Start

import asyncio
from dloader import DataLoader

# Define a batch loading function
async def batch_load_users(user_ids):
    # Fetch multiple users at once (e.g., from a database)
    users = await db_client.get_many(User, user_ids)
    return users

# Create a DataLoader instance
async with DataLoader(batch_load_users) as user_loader:
    # These calls are automatically batched
    user_1, user_2, other_users = await asyncio.gather(
        user_loader.load(1),
        user_loader.load(2),
        user_loader.load_many([3, 4, 5]),
    )

Versioning

This project follows CalVer. Expect couple of release per year with very minor changes.

License

MIT License - see LICENSE file for details.

Metadata

Release files for dloader 2025.7

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

Source distribution (sdist)

Source distribution for dloader 2025.7
File Size Uploaded Provenance Actions
dloader-2025.7.tar.gz 35.6 kB Without provenance Details for dloader-2025.7.tar.gz

Built distribution (wheel)

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

Total release size: 41.8 kB

Release files / dloader-2025.7.tar.gz

Download URL dloader-2025.7.tar.gz
Size 35.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1f81f6fc7125e41dec4463c51b25abc881af858cdc0152681c49cefb15b29651
BLAKE2b-256 checksum
How to use checksums
d534d08841fb784bbe9a95d6be66f41abed190a2ffbfc419ded1b18dc92bb93f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.3

Release files / dloader-2025.7-py3-none-any.whl

Download URL dloader-2025.7-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb39bd828a7c7d03a88dede85cf7b6bffc2c39b0d5aabaea5cce376d220faf74
BLAKE2b-256 checksum
How to use checksums
0b9a9c1e2bc0e4af4fb5a6e0a3684abd649b35e64d7793fb3b2cf282145a68d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.3

Security for dloader 2025.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.

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.

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