pyrunp exports Python functions from files to the command line
Project description
runp exports Python functions from files to the command line. You don’t need to change your existing code.
If you have a file named myfile.py with:
def foo(): """beeps a lot""" print "beep beep" def bar(text): """Prints things Args: text (str): The text to print """ print text
And you want to run it in the command line just do:
$ runp myfile.py foo beep beep
You can also pass arguments to your functions:
$ runp myfile.py bar:"this is sweet!" this is sweet!
Functions with names starting with _ are hidden.
You can list available functions with:
$ runp myfile.py -l Available functions: foo beeps a lot bar Prints things
And get info on a specific function:
$ runp myfile.py -d bar Displaying docstring for function bar in module myfile bar(text) Prints things Args: text (str): The text to print
Syntax for calling functions is:
$ runp myfile.py function_name:arg1value,arg2=arg2value
The concept, syntax for commands and initial code are heavily inspired by fabric’s task system.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyrunp-0.0.3.tar.gz
.
File metadata
- Download URL: pyrunp-0.0.3.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fe128e1c13c12f06a6d9ec9cfcba97d0e1d0955420f38dd53c8ec51b5615505 |
|
MD5 | 02663559baa4cb7926ba737f3f0283f9 |
|
BLAKE2b-256 | 1cc7e5e8749d0fa0515a8de969b2a9ad2bf8e8a73e7c2f049ed51dd5b692d846 |
File details
Details for the file pyrunp-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: pyrunp-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fbbf170d133b9403d00ec2b0c934e1b18916a29bdde7a0d09f27c0ad7f30576 |
|
MD5 | b1e0f55b30772f549288100fa11c33a3 |
|
BLAKE2b-256 | 92d2c497debf0100e5a3b14ce77ac28ee4988fcb3664b4f372740a1c0715e1bd |