https://github.com/mattmoony/pash
Interactive shell for python scripts ... Since I used one in many of my latter projects and don't want to develop a new one everytime. 👓
https://github.com/mattmoony/pash
arguments cool interactive programming python scripting scripts shell structure
Last synced: about 1 month ago
JSON representation
Interactive shell for python scripts ... Since I used one in many of my latter projects and don't want to develop a new one everytime. 👓
- Host: GitHub
- URL: https://github.com/mattmoony/pash
- Owner: MattMoony
- License: gpl-3.0
- Created: 2020-04-06T18:10:48.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-28T09:13:04.000Z (almost 5 years ago)
- Last Synced: 2025-01-19T10:31:08.565Z (about 1 year ago)
- Topics: arguments, cool, interactive, programming, python, scripting, scripts, shell, structure
- Language: Python
- Homepage: https://pash.readthedocs.io/
- Size: 50.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pash.readthedocs.io/en/latest/?badge=latest)   
# 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:
```bash
python3 -m pip install pash-cmd
```
## Usage
First, create a shell ...
```python
from pash.shell import Shell
sh = Shell(prompt='$ ')
```
... and then, simply add as many commands as you want/need!
```python
from pash.command import Command
sh.add_command(Command('ping', callback=pong))
...
```
You can even create _cascading commands_ ...
```python
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](https://pash.readthedocs.io). (Please excuse the messiness, it's my first time working with sphinx, readthedocs, etc. ^^)
---
... Matthias M. (April 2020)