Skip to main content

Summary

This project is a base class for running various commands in python from the command line.

see sample/toolbox_app.py for an example use.

see doc/api.md for the API available.

how to run

Don't specify a command gives you help. Note that you can use check() in toolbox_runner.py or run() in toolbox_app.py to specify a default command.

./doit 
WARN no command chosen, nothing to do
     py-runner-base: v0.1.0
     Choose one of these:
        task1               : run task1
        task2a              : run task2 step-a
        task2b              : run task2 step-b
        task3               : run task3
        task4               : run task4

Note: that there are several sorting orders available, see property sort_order in base_runner.py or cmd_map.py.

  • Add an argument arg1:
$ ./doit task1 arg1
==== doit: starting...
     running Task1 args:['arg1']
     doit: run_it rc=0
  • Run a command "task1" that has no prerequisites:
./doit task1
==== doit: starting...
     running Task1 args:[]
     doit: run_it rc=0
  • Run a command "task2b" that has a prerequisite:
./doit task2b
==== doit: starting...
     running Task2 step-a
     running Task2 step-b
     doit: run_it rc=0

how to add commands

See the sample/taskxx.py files for example tasks. Note register() functions that allow you to specify command names for any tasks you want to add.

    # --------------------
    def register(self, runner):
        self._runner = runner
        self._runner.add_cmd('task2a', self._run_step_a, 'run task2 step-a')
        self._runner.add_cmd('task2b', self._run_step_b, 'run task2 step-b', prereqs=['task2a'])

Metadata

Release files for py-runner-base 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-runner-base 1.2.1
File Size Uploaded Provenance Actions
py_runner_base-1.2.1.tar.gz 10.5 kB Without provenance Details for py_runner_base-1.2.1.tar.gz

Release files / py_runner_base-1.2.1.tar.gz

Download URL py_runner_base-1.2.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e41b29714ca6ba66d4acb45c2d125bb732e0589da22df05e3d4347c5a8f42803
BLAKE2b-256 checksum
How to use checksums
2367700534221fcca47c70cce23f48c3b8bbb35c76eb2a9197dd06c7db71df08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for py-runner-base 1.2.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page