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.4.tar.gz (28.9 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.4-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pynix_sh-0.1.4.tar.gz
  • Upload date:
  • Size: 28.9 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.4.tar.gz
Algorithm Hash digest
SHA256 cd48762262a93435630e783116632ef964b10c74303e6e9bf3f31e7651b2afe4
MD5 f571c80676dd19266ab479e66632e516
BLAKE2b-256 31ea9d69ceb8caaf6b7ad914664622d8b380fb3ae1c50aed30de01ab0060153b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pynix_sh-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 28.3 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f30dc2b793e55e725bac467929265c5023955de874a4828a3f1a7d0f2604f115
MD5 f806b767ca7c3cc44487d2de7376436e
BLAKE2b-256 cf0670bf999f4e0e8ada35a677c31cf59ad4c1b532d19d9a22f867de03d79f33

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