Skip to main content

multithreader

Overview

Execute Python functions with multithreading.

Usage

Installation:

pip3 install multithreader
# or
python3 -m pip install multithreader

Example:

def test_function(
    iterator,
    items
) -> int:
    """Sum two numbers."""
    print(iterator)
    sleep(1)
    return items['a'] + items['b']

# Import multithreader.
from multithreader import threads

# Define arguments.
items = {
    'a': 1,
    'b': 2
}

# Define iterators.
iterators = [1, 2, 3, 4, 5]

# Execute function with multithreading.
results = threads(
    test_function,
    iterators,
    items,
    thread_num=int(sys.argv[1])
)

# Print results.
print(results)

Full Example

Metadata

Release files for multithreader 1.0.5

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

Source distribution (sdist)

Source distribution for multithreader 1.0.5
File Size Uploaded Provenance Actions
multithreader-1.0.5.tar.gz 2.1 kB Without provenance Details for multithreader-1.0.5.tar.gz

Built distribution (wheel)

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

Total release size: 5.5 kB

Release files / multithreader-1.0.5.tar.gz

Download URL multithreader-1.0.5.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
83868fff44776c5f072821f49405ef405ccb2c7dc674c71cd6ee380f11e6dde8
BLAKE2b-256 checksum
How to use checksums
d697120f4541a90c81dc1c07cb1b08171f2dcd64b85efe3e12b52145da9e4e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/5.15.154+

Release files / multithreader-1.0.5-py3-none-any.whl

Download URL multithreader-1.0.5-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
067cd38d1ef38755a483b61809c088a56e6805a444802fee97acff0d19beb4f4
BLAKE2b-256 checksum
How to use checksums
d0f1977eb6a3a16a98ece214415db987d3cf19cd9b5277aaaa041dccdec5ddde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/5.15.154+

Security for multithreader 1.0.5

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