docs |
|
|---|---|
package |
Simple task library using asyncio.
Free software: MIT License
Installation
pip install robot-tasks
You can also install the in-development version with:
pip install https://github.com/fmorton/robot-tasks/archive/main.zip
Tasks Example with a Birdbrain Robot
from robot.hummingbird import Hummingbird
from robot.tasks import Tasks
async def task_1(bird):
while True:
print("task_1 running")
await Tasks.yield_task(1.0)
async def task_2(bird):
while True:
print("task_2 running")
await Tasks.yield_task(0.5)
bird = Hummingbird("A")
tasks = Tasks()
tasks.create_task(task_1(bird))
tasks.create_task(task_2(bird))
tasks.run()
Processes Example with a Birdbrain Robot
import random
from robot.hummingbird import Hummingbird
from robot.processes import Processes
from time import sleep
def random_blinker(hummingbird):
for i in range(35):
hummingbird.tri_led(1, random.randint(0, 100), random.randint(0, 100), random.randint(0, 100))
sleep(0.1)
def blue_blinker(hummingbird):
for i in range(35):
hummingbird.tri_led(1, 0, 0, 100)
sleep(0.1)
if __name__ == '__main__':
hummingbird = Hummingbird('A')
processes = Processes()
processes.create_process(random_blinker, (hummingbird,))
processes.create_process(blue_blinker, (hummingbird,))
processes.run()
hummingbird.tri_led(1, 0, 0, 0)
Testing
To run all the tests run:
pytest
Metadata
Release files for robot-tasks 0.2.3
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 |
|---|---|---|---|---|
| robot_tasks-0.2.3.tar.gz | 7.5 kB | Without provenance | Details for robot_tasks-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| robot_tasks-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for robot_tasks-0.2.3-py3-none-any.whl |
Total release size: 11.6 kB
Release files / robot_tasks-0.2.3.tar.gz
| Download URL | robot_tasks-0.2.3.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7af056506852b12aad7e31a1afa6d77d8f293578beb833817bd4ff299614cd2b
|
|
BLAKE2b-256 checksum How to use checksums |
79a9d7cea97ad27d574570a447cf30538e5692265cd04ab57cc176039112e65f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / robot_tasks-0.2.3-py3-none-any.whl
| Download URL | robot_tasks-0.2.3-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34eea0a96bc7b704dccb7b9f650cb42a297bed7f01d9e06febfad428310f426f
|
|
BLAKE2b-256 checksum How to use checksums |
d4592172b23815fb81cd8fa5d5b7a76a9f64acd14a92883201f792ce2c761116
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for robot-tasks 0.2.3
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.