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.3.tar.gz (28.5 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.3-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pynix_sh-0.1.3.tar.gz
  • Upload date:
  • Size: 28.5 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.3.tar.gz
Algorithm Hash digest
SHA256 e58907637bbd1aebd9a9bfb77884501674d2cb3e5e8bc2c8b8b1c6966ae3a4d2
MD5 810ad2509aa202269f4fb6878bac1f13
BLAKE2b-256 ff9fb39ddee7ef909573259839c26cb8ad48c6f8c930469ec66176d6873f6a46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pynix_sh-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 28.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d0243f3ed9b9ef5a69411fca3bcf908742893440428965d40b13fee74f4dbf14
MD5 a3daeef4181911893659b7679f2eff76
BLAKE2b-256 cf3234cda2a2447889eb9a866d6be2dce3d994c7f3c3244d11c37cc00264b1a0

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