From 8eee64d712b46f1dd94c6493f9e25ec706b1af27 Mon Sep 17 00:00:00 2001 From: NightMachinary <36224762+NightMachinary@users.noreply.github.com> Date: Tue, 25 Aug 2020 17:07:28 +0430 Subject: [PATCH] Added related projects to the readme Added related projects to the readme, including my own project https://github.com/NightMachinary/brish. --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 8c94ce1..c7d752a 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,29 @@ duct.StatusError: Expression cmd('false') returned non-zero exit status: Output( >>> cmd("false").unchecked().run() Output(status=1, stdout=None, stderr=None) ``` + +Related projects +================ + +- [Brish](https://github.com/NightMachinary/brish) allows you to use persistent (or not) zsh sessions from Python. Brish uses Python's metaprogramming APIs to achieve near first-party interoperability between the two languages. + +- [pysh](https://github.com/sharkdp/pysh) uses comments in bash scripts to switch the interpreter to Python, allowing variable reuse between the two. + +- [plumbum](https://github.com/tomerfiliba/plumbum) is a small yet feature-rich library for shell script-like programs in Python. It attempts to mimic the shell syntax (\"shell combinators\") where it makes sense, while keeping it all Pythonic and cross-platform. + +- [xonsh](https://github.com/xonsh/xonsh) is a superset of Python 3.5+ with additional shell primitives. + +- [daudin](https://github.com/terrycojones/daudin) [tries](https://github.com/terrycojones/daudin#how-commands-are-interpreted) to eval your code as Python, falling back to the shell if that fails. It does not currently reuse a shell session, thus incurring large overhead. I [think](https://github.com/terrycojones/daudin/issues/11) it can use Brish to solve this, but someone needs to contribute the support. + +- `python -c` can also be powerful, especially if you write yourself a helper library in Python and some wrappers in your shell dotfiles. An example: + + ``` {.example} + alias x='noglob calc-raw' + calc-raw () { + python3 -c "from math import *; print($*)" + } + ``` + +- [Z shell kernel for Jupyter Notebook](https://github.com/danylo-dubinin/zsh-jupyter-kernel) allows you to do all sorts of stuff if you spend the time implementing your usecase; See [emacs-jupyter](https://github.com/nnicandro/emacs-jupyter#org-mode-source-blocks) to get a taste of what\'s possible. [Jupyter Kernel Gateway](https://github.com/jupyter/kernel_gateway) also sounds promising, but I haven\'t tried it out yet. Beware the completion support in this kernel though. It uses a pre-alpha proof of concept [thingy](https://github.com/Valodim/zsh-capture-completion) that was very buggy when I tried it. + +- Finally, if you\'re feeling adventurous, try Rust\'s [rust_cmd_lib](https://github.com/rust-shell-script/rust_cmd_lib). It\'s quite beautiful.