Skip to main content

runp exports Python functions from files to the command line

Project description

runp

Python package Coverage Status PyPI version Python Versions

This repository is a modified of runp, which is no longer maintained, for modern Python 3.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

runp3-0.0.6.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

runp3-0.0.6-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file runp3-0.0.6.tar.gz.

File metadata

  • Download URL: runp3-0.0.6.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for runp3-0.0.6.tar.gz
Algorithm Hash digest
SHA256 cb6e13ac28f68243bbb8865b41a225fc1740184999b9ef98f1374a0b62c45418
MD5 b88047521c00329cf8373dafd7dfadc4
BLAKE2b-256 acce1765cbe5497b58ea1e074e2b2640b0ba63513012f4207b937a1d890dd350

See more details on using hashes here.

File details

Details for the file runp3-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: runp3-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for runp3-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 08f1757a2a360f8f20345c941eb1797256e8e1eab7b7a1718a09ac74970b3759
MD5 1d68e17b72893dce6d058ceecb72b64f
BLAKE2b-256 33d80f3e87b829afa35c563388ab72dc6104087523895a1455759440e2e08a3d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page