Skip to main content

aiojournal

An asynchronous batch execution runner with results persistence and resumability.

Especially useful when making concurrent API calls while directly saving each request's result, for example when benchmarking LLM models, from big providers or inference engines. It is minimal and lightweight, only dependency is tqdm.

pip install aiojournal

Example

import asyncio
from pathlib import Path

from aiojournal import AsyncBatchRunner


async def describe(value: int) -> dict[str, int | str]:
    await asyncio.sleep(0.1)
    return {
        "result": value * 2,
        "input": value,
        "parity": "even" if value % 2 == 0 else "odd",
    }


async def main() -> None:
    runner = AsyncBatchRunner(
        max_concurrency=2,
        results_file_path=Path("tasks.csv"),
    )
    results = await runner.map(
        describe,
        args_list=[{"value": 1}, {"value": 2}, {"value": 3}],
        task_ids=["one", "two", "three"],
    )
    # {"result": 2, "input": 1, "parity": "odd"}
    # {"result": 4, "input": 2, "parity": "even"}
    # {"result": 6, "input": 3, "parity": "odd"}


asyncio.run(main())

Each task appends a row to tasks.csv. The journal can be read without loading the whole file:

for result in runner.read_results_csv():
    print(result["task_id"], result["success"], result["result"])

And will look like this (with different timestamps and durations):

task_id,start_time,end_time,duration_seconds,success,result,error,input,parity
one,2026-08-23T16:00:00+00:00,2026-08-23T16:00:00.100000+00:00,0.1000,True,2,,1,odd
two,2026-08-23T16:00:00+00:00,2026-08-23T16:00:00.100000+00:00,0.1000,True,4,,2,even
three,2026-08-23T16:00:00.100000+00:00,2026-08-23T16:00:00.200000+00:00,0.1000,True,6,,3,odd

Columns names are inferred from the dictionary returned by the function provided to the map method. The function may also return plain text, which in this case will be written in a result column.

By default, if a task fails, map and gather returns/saves it's exception while running the rest of the batch.

Metadata

Release files for aiojournal 0.0.1

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

Source distribution (sdist)

Source distribution for aiojournal 0.0.1
File Size Uploaded Provenance
aiojournal-0.0.1.tar.gz 15.4 kB With provenance Details

Built distribution (wheel)

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

Total release size: 29.5 kB

Release files / aiojournal-0.0.1.tar.gz

Download URL aiojournal-0.0.1.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ddc7a3332aef1995d6b4c48324465bd688af361722de954d53fd35837729ca3e
BLAKE2b-256 checksum
How to use checksums
9c0fbe7ca61be5047573751d22c628f83236064decb45b0b87e95272fee35dbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / aiojournal-0.0.1-py3-none-any.whl

Download URL aiojournal-0.0.1-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94f2cfd67bf342075ef631adc9aa41c8430e2a9a116773206a2e57da12d79e60
BLAKE2b-256 checksum
How to use checksums
dccf67457e7887e275577e77345199bcf50e09dd5fdd78e394aaa85b8ed734f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Security for aiojournal 0.0.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aiojournal-0.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

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

0.0.1 This release

2 release files Full 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