Skip to main content

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 logging module)
  • 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 execute
  • max_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

threadman-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

threadman-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

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

Hashes for threadman-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bc33d79ee7f582ca146db29bd5db8990bc685d0c33f891cfc92b9d472e813e40
MD5 0328460c6520e0374446b0f8bba662e3
BLAKE2b-256 de9cfae7da1ea97347afd914049eb881c83ddfc6157167aded42de9da1aa27df

See more details on using hashes here.

Provenance

The following attestation bundles were made for threadman-0.1.0.tar.gz:

Publisher: create_artifacts_and_publish.yaml on rpunt/threadman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for threadman-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eada384b7416d5003f3ced52169483d57ec3019eee8fbe23f26d7ba73b4ceb99
MD5 52a2b76537b292c2afe5e8c3a106dc99
BLAKE2b-256 1b96f5d1725c89f4651b161ff57625c0131ad676a94d9e2950ab6da2298d51bf

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page