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 instead of raising, so 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):
logger.error("Got error: %s", 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.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| djmapl-0.5.0.tar.gz | 4.6 kB | Without provenance | Details for djmapl-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| djmapl-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for djmapl-0.5.0-py3-none-any.whl |
Total release size: 9.9 kB
Release files / djmapl-0.5.0.tar.gz
| Download URL | djmapl-0.5.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1e00c20a9a4bbe2f4182f9fe147e24898ff7e45ed57a9e109ebe513f8edc526
|
|
BLAKE2b-256 checksum How to use checksums |
2259e536186f4babcf4fb25fd81c0fc74c9f329831f32cdd854c0915a43d028b
|
| 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.5.0-py3-none-any.whl
| Download URL | djmapl-0.5.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c201ba3582645787aeac67844eeb614db7099f956fbf5d7e62c4872d865981a
|
|
BLAKE2b-256 checksum How to use checksums |
418a0fd9f221aead2f522968075231f26a9e98158df6d99bca7bbb9bb98a3554
|
| 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.5.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.