Skip to main content

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

pynix_sh-0.1.5.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynix_sh-0.1.5-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file pynix_sh-0.1.5.tar.gz.

File metadata

  • Download URL: pynix_sh-0.1.5.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for pynix_sh-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ee424ea643f8d0cfd23bcbf84e73c45ee1fdb9c1e8ff03ece758879c36bb546d
MD5 17c363c824417e04e9176705fe537d18
BLAKE2b-256 db5218391c095c73bf9809a476b6cb972882fbbee4859e4cfa624dca47d4005e

See more details on using hashes here.

File details

Details for the file pynix_sh-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pynix_sh-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for pynix_sh-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7bb2f7b12593555ccd00cf70eaf84e77373e6005b5065e01d112be37c07ce607
MD5 d330f5d7061096450f46515c5d4a1b63
BLAKE2b-256 9fb35a13b694e9accf6aa0d54772c710a25bea4978cf594714f5675b892aacb6

See more details on using hashes here.

Supported by

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