simpletasks
Simple tasks runner for Python.
This can be helpful to handle automated processes and make them available via command line interface via click.
Usage
Sample:
import click
from simpletasks import Cli, CliParams, Task
@click.group()
def cli():
pass
@Cli(cli, params=[click.argument("n", type=int), CliParams.progress()])
class FibonacciTask(Task):
def compute(self, n: int) -> int:
self.logger.debug(f"Called with n={n}")
f1, f2 = 0, 1
if n == 0:
return f1
if n == 1:
return f2
for _ in self.progress(range(1, n)):
f1, f2 = f2, f1 + f2
return f2
def do(self) -> None:
n = cast(int, self.options.get("n"))
result = self.compute(n)
print(f"f({n}) = {result}")
if __name__ == "__main__":
cli()
Gives:
$ python sample/compute.py fibonacci 3 --no-progress
f(3) = 2
Contributing
To initialize the environment:
poetry install --no-root
poetry install -E click -E tqdm
To run tests (including linting and code formatting checks), please run:
poetry run pytest --mypy --flake8 && poetry run black --check .
Metadata
Release files for simpletasks 0.1.2
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 |
|---|---|---|---|---|
| simpletasks-0.1.2.tar.gz | 11.1 kB | Without provenance | Details for simpletasks-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simpletasks-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for simpletasks-0.1.2-py3-none-any.whl |
Total release size: 23.4 kB
Release files / simpletasks-0.1.2.tar.gz
| Download URL | simpletasks-0.1.2.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fbeba7431a1ad8470ff76190f4d567acc7a595108b1a296c2ab775f52f435384
|
|
BLAKE2b-256 checksum How to use checksums |
e36f47211f41c164cfbe1409cbb8bad6e5049e14f2680e8ba6d10cf9620c42a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.6.7 Linux/4.15.0-1077-gcp
|
Release files / simpletasks-0.1.2-py3-none-any.whl
| Download URL | simpletasks-0.1.2-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
511736b7e98bff978d6f2620f176fd61cbea193ee61ed0efa0f4ebaf0b508b89
|
|
BLAKE2b-256 checksum How to use checksums |
8e8ef191431ff7c93da062ae60c874229ef0df8e570864822a98364ec5162e9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.6.7 Linux/4.15.0-1077-gcp
|
Security for simpletasks 0.1.2
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.