An interactive shell for Python scripts.
Project description
pash
About
Since many of my recent Python projects have included an interactive shell / command prompt of some sorts, I've decided to write my own package for it, so that I won't have to think of a new way of handling commands everytime.
I hope it can be of some use to other Python programmers as well, as it'll hopefully make my life a lot easier.
Install
Installing pash is very easy thanks to pip:
python3 -m pip install pash-cmd
Usage
First, create a shell ...
from pash.shell import Shell
sh = Shell(prompt='$ ')
... and then, simply add as many commands as you want/need!
from pash.command import Command
sh.add_command(Command('ping', callback=pong))
...
You can even create cascading commands ...
from pash.command import CascCommand
sh.add_command(CascCommand('go', cmds=[
Command('north', callback=gnorth),
Command('south', callback=gsouth),
]))
...
Documentation
The full docs are hosted here. (Please excuse the messiness, it's my first time working with sphinx, readthedocs, etc. ^^)
... Matthias M. (April 2020)
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pash-cmd-0.0.7.tar.gz.
File metadata
- Download URL: pash-cmd-0.0.7.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
688c9e7bd79eb5044c8ae0d0281f1acb1802dea7ed8fd6eff146590aaaa7642b
|
|
| MD5 |
5c521d9737bc0778c9902e38909a848d
|
|
| BLAKE2b-256 |
051721f2abc244402965a0942c08a3254e0fb02f9f104beced7f6c37ca923fed
|
File details
Details for the file pash_cmd-0.0.7-py3.9.egg.
File metadata
- Download URL: pash_cmd-0.0.7-py3.9.egg
- Upload date:
- Size: 19.0 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb72244276074408aca99c563ecc22c489faf856cc2cbfb92b6c52fa320618c3
|
|
| MD5 |
024ddda3a897ca3b101f8d9b72b0e6fc
|
|
| BLAKE2b-256 |
d3c30969bfc0691fa2f3e94f5e508ca89d49b3016b4eca9f1e9141a0794c9527
|
File details
Details for the file pash_cmd-0.0.7-py3-none-any.whl.
File metadata
- Download URL: pash_cmd-0.0.7-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d93eb37a35c4270865ec149c871b60a8ce73d9a3661f6a644dce300153f72a10
|
|
| MD5 |
9681546f34e34603a5a739050d762cdd
|
|
| BLAKE2b-256 |
5042a224fa9b9ce615a42718e2a5d74de321e5244ee9edb5ec79a7a2947f8391
|