Skip to main content

DjMAPL

These are small Django utilities we find helpful and are used across projects.

Utilities

call_concurrently

Runs an async function over many items, at most concurrency at a time, with an optional tqdm progress bar. Results are yielded in completion order. A failed item yields its exception, with a Failed item: <item> note, instead of raising. Check each result:

from djmapl.concurrency import call_concurrently

async for result in call_concurrently(
    concurrency=10,
    func=process_report,  # called as process_report(item, client=client)
    items=reports,
    show_progress=True,
    client=client,  # extra kwargs are passed to func
):
    if isinstance(result, Exception):
        # exc_info prints the traceback, including the `Failed item` note
        logger.error("Got error", exc_info=result)

progress_callback(pbar, result) runs after each item, even when the bar is hidden, e.g. to show a running total with pbar.set_postfix_str(...).

All items are scheduled up front, so split very large inputs into batches. If you break out of the loop early, the remaining items are cancelled when the generator is closed. Use contextlib.aclosing to close it right away:

from contextlib import aclosing

results = call_concurrently(...)
async with aclosing(results):
    async for result in results:
        if should_stop(result):
            break

Running Tests

uv run pytest

Publishing

uv version --bump minor
uv build

# save the credentials using `uv auth login upload.pypi.org`
uv publish --username __token__

Metadata

Release files for djmapl 0.6.0

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

Source distribution (sdist)

Source distribution for djmapl 0.6.0
File Size Uploaded Provenance Actions
djmapl-0.6.0.tar.gz 4.8 kB Without provenance Details for djmapl-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.3 kB

Release files / djmapl-0.6.0.tar.gz

Download URL djmapl-0.6.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e8df8dff2c8a41865ed3edcb7c4b553c1b1b23a0b6b7a39d25f386c99ae0b463
BLAKE2b-256 checksum
How to use checksums
b3565edea7bd8436654445022058642364f8811fc7592c3f3de2f0ac576ec98e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / djmapl-0.6.0-py3-none-any.whl

Download URL djmapl-0.6.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4df56dfd5709fb08c96438d7c0d7a42642823f4ad982be94b603a999157b0e60
BLAKE2b-256 checksum
How to use checksums
9ea4a00c9f9307177753703be93d395ddcc773a9da284e9a251bf36e1d5a1aa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for djmapl 0.6.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.

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