thread6
Simple parallel processing interface for python
Why?
Python's built in parallel processing and threading library is pretty simple to implement but sometimes you just want to chuck data at a function and make it run faster
Requirements
Python 3+
Installation
Quickstart
Use the threaded decorator to turn a method into a threaded method. That's it!
@thread6.threaded()
def threaded_print():
print("")
return 1
Alternatively, use run_threaded function
thread6.run_threaded(threaded_print)
Both the threaded decorator and run_threaded method will return an instance of
ResultThread. This allow you to optionally wait for the function to finish executing
and get the return value. To get the return value, use .await_output()
result = threaded_print()
result.await_output() # this will return 1
If you have a function that needs to execute on a large list of data, use run_chunked
def update_items(items):
...
items = [...]
thread6.run_chunked(update_items, items)
.await_output() also work with run_chunked but will return a list of return values instead
Usage
Todo
- threaded function decorator
- run something in a separate thread function
- split data into chunk and run in separate threads
- add way for errors to fail loudly
- auto spawn to run fx on a set of data
- explore multi processing?
Metadata
Release files for thread6 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| thread6-0.2.0.tar.gz | 3.6 kB | Without provenance | Details for thread6-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| thread6-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for thread6-0.2.0-py3-none-any.whl |
Total release size: 7.8 kB
Release files / thread6-0.2.0.tar.gz
| Download URL | thread6-0.2.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed7a398e7f4d7fcedfcbc689ed3ef11179b040ead277ba15a6b316ff7d4d1b81
|
|
BLAKE2b-256 checksum How to use checksums |
39f2cd7b53367c00a0e4a37c53c5b18007a50fb66f19331699c894c918230b8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4
|
Release files / thread6-0.2.0-py3-none-any.whl
| Download URL | thread6-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
618037241f4a486940ca8e9c1f8cb0a476473c6036dc10a717c1ff5fbdabd7fc
|
|
BLAKE2b-256 checksum How to use checksums |
f0463a1220d4f933c1a2b4eba2d0d9306cac0ba0d758a9c3958a4213edba6866
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4
|
Security for thread6 0.2.0
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.