A simple thread manager for Python
Project description
threadman
A simple, type-annotated thread manager for Python. Easily manage and execute tasks concurrently using a configurable thread pool, with progress bar and logging support.
Features
- Simple API for concurrent task execution
- Configurable thread pool size
- Progress bar (via
tqdm) - Logging support (uses Python's
loggingmodule) - Type annotations for better IDE and type checker support
Installation
pip install threadman
Or install from source:
git clone https://github.com/your-username/threadman.git
cd threadman
uv build
pip install dist/threadman-*.whl
Usage Example
from threadman import ThreadManager
def my_task(item):
print(f"Processing {item}")
items = [1, 2, 3, 4, 5]
opts = {
"work_params": items,
"max_threads": 3,
"progress_bar_title": "Processing Items",
"output_status": True,
}
manager = ThreadManager(opts)
manager.run(my_task)
Options
work_params: List of tasks to executemax_threads: Maximum number of concurrent threads (default: 10)progress_bar_title: Title for the progress bar (optional)output_status: Enable logging/progress output (default: True if more than one task)update_seconds: Progress/log update interval (default: 60)queue_timeout: Timeout for queue operations (default: None)
License
MIT
For more details, see the code and docstrings in the threadman package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file threadman-0.1.0.tar.gz.
File metadata
- Download URL: threadman-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc33d79ee7f582ca146db29bd5db8990bc685d0c33f891cfc92b9d472e813e40
|
|
| MD5 |
0328460c6520e0374446b0f8bba662e3
|
|
| BLAKE2b-256 |
de9cfae7da1ea97347afd914049eb881c83ddfc6157167aded42de9da1aa27df
|
Provenance
The following attestation bundles were made for threadman-0.1.0.tar.gz:
Publisher:
create_artifacts_and_publish.yaml on rpunt/threadman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
threadman-0.1.0.tar.gz -
Subject digest:
bc33d79ee7f582ca146db29bd5db8990bc685d0c33f891cfc92b9d472e813e40 - Sigstore transparency entry: 336596271
- Sigstore integration time:
-
Permalink:
rpunt/threadman@0c2d4acdbd3af97720f383f1577e60ba5b9e7a53 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rpunt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
create_artifacts_and_publish.yaml@0c2d4acdbd3af97720f383f1577e60ba5b9e7a53 -
Trigger Event:
push
-
Statement type:
File details
Details for the file threadman-0.1.0-py3-none-any.whl.
File metadata
- Download URL: threadman-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eada384b7416d5003f3ced52169483d57ec3019eee8fbe23f26d7ba73b4ceb99
|
|
| MD5 |
52a2b76537b292c2afe5e8c3a106dc99
|
|
| BLAKE2b-256 |
1b96f5d1725c89f4651b161ff57625c0131ad676a94d9e2950ab6da2298d51bf
|
Provenance
The following attestation bundles were made for threadman-0.1.0-py3-none-any.whl:
Publisher:
create_artifacts_and_publish.yaml on rpunt/threadman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
threadman-0.1.0-py3-none-any.whl -
Subject digest:
eada384b7416d5003f3ced52169483d57ec3019eee8fbe23f26d7ba73b4ceb99 - Sigstore transparency entry: 336596298
- Sigstore integration time:
-
Permalink:
rpunt/threadman@0c2d4acdbd3af97720f383f1577e60ba5b9e7a53 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rpunt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
create_artifacts_and_publish.yaml@0c2d4acdbd3af97720f383f1577e60ba5b9e7a53 -
Trigger Event:
push
-
Statement type: