Skip to main content

Mechanicus

Parallel execute with asyncio library

Install

pip3 install mechanicus

Dependencies

  • python >=3.7
  • aiohttp
  • aiofiles

Examples

Parallel file download

executor = QueueExecutor(Downloader())
await executor.execute([
    DownloadTask(
        "https://file-examples-com.github.io/uploads/2017/02/file_example_CSV_5000.csv",
        "/home/user/Downloads/example.csv",
    ),
    DownloadTask(
        "https://file-examples-com.github.io/uploads/2017/02/file_example_JSON_1kb.json",
        "/home/user/Downloads/example.json",
    )
])

Parallel custom task execute

async def source(count):
    for i in range(count):
        print(f"new: {i}")
        yield i
        await asyncio.sleep(0.2)

class CustomExecutor(TaskExecutor[int, int]):
    async def execute(self, task: int):
        print(f"start: {task}")
        await asyncio.sleep(0.5)
        print(f"complete: {task}")
        return task

executor = QueueExecutor(CustomExecutor())
result = await executor.execute(source(20))
print(f"result: {result}")

Metadata

Release files for mechanicus 0.0.2

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

Source distribution (sdist)

Source distribution for mechanicus 0.0.2
File Size Uploaded Provenance Actions
mechanicus-0.0.2.tar.gz 3.5 kB Without provenance Details for mechanicus-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 6.9 kB

Release files / mechanicus-0.0.2.tar.gz

Download URL mechanicus-0.0.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b26b600935f45c941049f734de23e6c678e3f3089b285d54e188637a8a3b4773
BLAKE2b-256 checksum
How to use checksums
faf946347fc83ec4fc2468dfa274c287b441d5fa36ce326662fa92b8f0b350f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.0.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / mechanicus-0.0.2-py3-none-any.whl

Download URL mechanicus-0.0.2-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4aedc57283f7317b563a45f2ac3451c42be2bb60c157bc45cdfa36382d8b82b
BLAKE2b-256 checksum
How to use checksums
b3850bbe8b2ed2fb11645c56c49df44ce688ac210208d8dc208aa81c31033685
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.0.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Security for mechanicus 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

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