Skip to main content

Rheo

CI codecov PyPI Python License Commits since release

Concurrent HTTP download orchestration with async I/O

What It Is

A Python library for managing multiple asynchronous HTTP downloads. Built on asyncio and aiohttp, it handles concurrency, tracks state, emits events, and lets you monitor progress.

Installation

pip install rheopy

Quick Start

import asyncio
from pathlib import Path
from rheo import DownloadManager
from rheo.domain import FileConfig

async def main():
    files = [
        FileConfig(url="https://example.com/file1.zip", priority=1),
        FileConfig(url="https://example.com/file2.pdf", priority=2),
    ]

    async with DownloadManager(download_dir=Path("./downloads"), max_concurrent=3) as manager:
        await manager.add(files)
        await manager.wait_until_complete()

    print("All downloads complete!")

asyncio.run(main())

Key Features

  • Concurrent downloads with worker pool
  • Priority queue
  • Selective cancellation (cancel individual downloads by ID)
  • Hash validation (MD5, SHA256, SHA512)
  • Retry logic with exponential backoff
  • Real-time speed & ETA tracking
  • File exists handling (skip, overwrite, or error)
  • Event-driven architecture with typed DownloadEventType and Subscription handles (manager.on() returns a handle with unsubscribe())
  • HTTP client abstraction (BaseHttpClient, default AiohttpClient)
  • CLI tool (rheo download)
  • Full type hints

CLI Usage

# Basic download
rheo download https://example.com/file.zip

# With hash verification
rheo download https://example.com/file.zip --hash sha256:abc123...

# Custom output directory
rheo download https://example.com/file.zip -o /path/to/dir

See CLI Reference for complete command documentation.

Documentation

Listen to Events

Subscribe to lifecycle events via manager.on(), which returns a Subscription handle:

from rheo.events import DownloadEventType, DownloadCompletedEvent

def on_completed(event: DownloadCompletedEvent) -> None:
    print(f"done: {event.download_id}")

async with DownloadManager(download_dir=Path("./downloads")) as manager:
    sub = manager.on(DownloadEventType.COMPLETED, on_completed)
    await manager.add([FileConfig(url="https://example.com/file.zip")])
    await manager.wait_until_complete()
    # sub.unsubscribe() when no longer needed

Use "*" to receive all events. Type-hint your handler for autocomplete on event fields.

Examples

Check examples/ for working code:

  • 01_basic_download.py - Simple single file download
  • 02_multiple_with_priority.py - Multiple files with priorities
  • 03_hash_validation.py - File integrity verification
  • 04_progress_display.py - Real-time progress bar with speed/ETA
  • 05_event_logging.py - Lifecycle event debugging
  • 06_batch_summary.py - Batch download with summary report

Project Status

Alpha - Core functionality works, but API may change before 1.0.

  • Python: 3.11+
  • License: MIT

Questions?

Open an issue on GitHub or check the full documentation.

Metadata

Release files for rheopy 0.7.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 rheopy 0.7.0
File Size Uploaded
rheopy-0.7.0.tar.gz 54.0 kB Details

Built distribution (wheel)

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

Total release size: 131.0 kB

Release files / rheopy-0.7.0.tar.gz

Download URL rheopy-0.7.0.tar.gz
Size 54.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6baf589536785f1b9710cc6eef25013e93b104c1f9a01ed264eb968fca4f0f45
BLAKE2b-256 checksum
How to use checksums
be107f498cf4075ac4e66d05daea364effd4cf3c7975df4f66ed742b83bb7efd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.2 Linux/6.11.0-1018-azure

Release files / rheopy-0.7.0-py3-none-any.whl

Download URL rheopy-0.7.0-py3-none-any.whl
Size 77.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ee5a26c28ae8f98dd26cab863ab493e1486c565e73284256f657401b782747d
BLAKE2b-256 checksum
How to use checksums
3451ec6d1cbc05bffa4dd605245f649d6bd52448c7e3d6c8a6c82f5464e4385d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.2 Linux/6.11.0-1018-azure

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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