Skip to main content

A small module to support automation of generating valid python variable names from external data.

Project description


threaders is a small module to help write

clean threaded code using threading decorators

and minimize repeating copy-paste actions.


Install and update using pip:

pip install -U threaders

A Simple Example:

from threaders import threaders

import time


def function_to_be_threaded(x):

“”” :rtype: Thread “””

t = time.time()


return time.time()-t

def main():

# create threads

threads = []

for i in range(10):


# get first result


# kill threads

t = time.time()

for thread in threads:


print(“all threads terminated: {}”.format(time.time()-t))

if __name__ == “__main__”:


Example with a thread pool:

from random import randrange

from time import sleep

import threading

delays = [randrange(1, 3) for i in range(50)]

print_lock = threading.Lock()

def wait_delay(i, d):

with print_lock:

print(‘{} sleeping for ({})sec’.format(i, d))


pool = threaders.ThreadPool(10)

for i, d in enumerate(delays):

pool.put(wait_delay, i, d)


Download files

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

Files for threaders, version 0.2.13
Filename, size File type Python version Upload date Hashes
Filename, size threaders-0.2.13.tar.gz (12.7 kB) File type Source Python version None Upload date Hashes View
Filename, size threaders-0.2.13-py2.py3-none-any.whl (10.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page