A Python-powered, cross-platform shell with seamless Python/shell integration
Project description
pynix.sh
pynix is a Python-powered, cross-platform shell. The language is a superset of Python 3 with seamless shell command integration.
| pynix is the Shell | pynix is Python |
cd ~
whoami > /tmp/user.txt
cat /etc/passwd | grep root
ls -la
|
2 + 2
var = "hello".upper()
import json
json.loads('{"a":1}')
[i for i in range(0, 10)]
|
| pynix is the Shell in Python | pynix is Python in the Shell |
len($(curl -L https://example.com))
result = !(ls /tmp)
print(result.returncode)
x = $(whoami)
echo "User: @(x)"
|
name = 'mosalah'
echo @(name) > /tmp/@(name)
files = ["a", "b", "c"]
for f in files:
$(touch @(f).txt)
def greet(name):
return f"Hello, {name}!"
echo @(greet("world"))
|
If you like pynix, ⭐ the repo!
First steps
Installation:
pip install pynix.sh
Launch:
pynix
Builtins
| Command | Description |
|---|---|
cd |
Change directory |
pwd |
Print working directory |
echo |
Print arguments |
type |
Show command type |
history |
Show command history |
exit |
Exit the shell |
about |
Display help for builtins |
activate |
Activate Python virtualenv |
deactivate |
Deactivate virtualenv |
Operators
| Operator | Description | Example |
|---|---|---|
@(expr) |
Expand Python expression | echo @(2 + 2) → echo 4 |
$(cmd) |
Capture stdout | x = $(whoami) |
!(cmd) |
Capture CommandResult | r = !(ls); print(r.returncode) |
&& |
Run if previous succeeded | true && echo yes |
|| |
Run if previous failed | false || echo no |
; |
Sequential execution | x = 1; echo @(x) |
| |
Pipe | echo hi | grep h |
Contributing
We welcome contributors! The codebase is small and focused. Start with:
- Running the test suite:
python -m unittest discover -s tests - Reading the architecture in
app/core/ - Report bugs, suggest features
License
MIT
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 Distribution
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 pynix_sh-0.1.2.tar.gz.
File metadata
- Download URL: pynix_sh-0.1.2.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23ecf8ec9f9b31aacb816e7d13e6d4261244d1b864713ff4b490c4238f91064c
|
|
| MD5 |
a6b383965b526455d2af01bca1dcaeb8
|
|
| BLAKE2b-256 |
3077b69bd28092114bcebf6571d550fa8b8fd6f0d80afc968925a66044bb6d8d
|
File details
Details for the file pynix_sh-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pynix_sh-0.1.2-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
301c3aec19ca6d60c6eead77a71907a186f9d6810199f73a210acc1da049e13c
|
|
| MD5 |
0c517e1c6f202c43e2cfb96c3048a569
|
|
| BLAKE2b-256 |
55a30b589e2e8eefe27a70953f4a8bf0a1342f7b9af070b0b1dead37c046f8e4
|