Blaster
Blaster is a library that provides the ability to blast off a list of tasks and call each of their given methods concurrently. Blaster uses Python's built-in multiprocessing library to run the list of tasks.
Installation
Blaster can be easily installed with a one line command. It is available on pypi. It is recommended (as best practice) to create a virtual environment and install blaster. Please see the commands below to install blaster.
# Create a python virtual environment
python3 -m venv venv
# Activate the virtual environment
source venv/bin/activate
# Install blaster
(venv) pip install blaster
Examples
At the root of blaster project, you will see a examples folder. Within this folder you will find simple examples on how you can use blaster to efficiently run many tasks.
Output
When blaster calls its blastoff method, on completion. It will return back to you a list of task results. Within each task dictionary it will have the original task data passed in along with a couple new keys. A status key which is an integer (0 or 1) to determine pass or fail. If a task failed, it would have a traceback key with the exception raised for helpful troubleshooting.
Terminology
Task
A task is a python dictionary that defines the task to be blasted off. A task must contain three keys name, task and methods. The name key just tells blaster what the task name is. The task key is a Python class reference. Finally the methods key is a list of methods to be run for the given task. You can then define any other key:value pairs that will be passed to the task given when an object is created for that class.
Below is an example task for building a contemporary house. You will see the task key has a value of the House class which contains all the methods defined. Blaster will create a house object (passing any extra data in this case style) and then call the methods defined.
[
{
'name': 'House #1',
'task': House,
'methods': [
'foundation',
'frame',
'roof',
'furnish',
'enjoy'
],
'style': 'contemporary'
}
]
You also have the ability to set a timeout for each task. If the timeout is reached, the task will be exited.
[
{
'name': 'House #1',
'task': House,
'methods': [
'foundation',
'frame',
'roof',
'furnish',
'enjoy'
],
'style': 'contemporary',
'timeout': 10
}
]
The nice feature with blaster is you can have multiple tasks but each one can call various methods within that task class. They do not all need to call the same methods! See the example below:
[
{
'name': 'House #1',
'task': House,
'methods': [
'foundation',
'frame',
'roof',
'furnish',
'enjoy'
],
'style': 'contemporary'
},
{
'name': 'House #2',
'task': House,
'methods': [
'foundation',
'frame',
'roof'
],
'style': 'cape'
}
]
Issues
For any issues that you may find while using blaster library. Please open a new issue or you can open pull request.
Metadata
Release files for blaster 0.6.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 |
|---|---|---|---|---|
| blaster-0.6.0.tar.gz | 24.5 kB | Without provenance | Details for blaster-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| blaster-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for blaster-0.6.0-py3-none-any.whl |
Total release size: 52.0 kB
Release files / blaster-0.6.0.tar.gz
| Download URL | blaster-0.6.0.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78c365b6e056107e0aa29fddb91cb07ecbc66e2ed066c29d3a92e0e8364fe92b
|
|
BLAKE2b-256 checksum How to use checksums |
7ca63df19807d71e2b644ca47a63efffc8197b2bdf72f78bc315711a349b014a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.1
|
Release files / blaster-0.6.0-py3-none-any.whl
| Download URL | blaster-0.6.0-py3-none-any.whl |
|---|---|
| Size | 27.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
594d6754c18f0514c62aa2498df7a489d9cb8fae7157c07a45b49e0a67bf9605
|
|
BLAKE2b-256 checksum How to use checksums |
d426d74c5796e0c916b2496618cbc748a06525cb5883150ba9e3422449d4cda1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.1
|
Security for blaster 0.6.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.