quotish is a combinator library for building command lines and shell snippets using PEP 750 template strings. Grab it from PyPI or read the documentation on ReadTheDocs.
>>> import quotish as qsh
>>> # Safely interpolate values into argument lists or shell-safe strings.
>>> msg = 'hello, world'
>>> qsh.cmd(t'echo {msg}!').argv()
['echo', 'hello, world!']
>>> qsh.cmd(t'echo {msg}!').render()
"echo 'hello, world!'"
>>> # Interpolate into shell lines instead to preserve shell syntax constructs.
>>> qsh.shell(t'echo {msg}; echo 123').render()
"echo 'hello, world'; echo 123"
>>> # Unpack sequences, build cartesian products, and compose the resulting
>>> # command lines together.
>>> host = 'host'
>>> pkgs = ['ripgrep', 'just']
>>> dnf = qsh.cmd(t'dnf install -y {pkgs:*}')
>>> inner = qsh.shell(rt"echo '- '{pkgs:^}$'\n' ; {dnf:*}")
>>> qsh.cmd(t'ssh {host} {inner}').argv()
['ssh', 'host', "echo '- 'ripgrep$'\\n' '- 'just$'\\n' ; dnf install -y ripgrep just"]
Release files for quotish 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| quotish-0.1.0.tar.gz | 19.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| quotish-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.0 kB
Release files / quotish-0.1.0.tar.gz
| Download URL | quotish-0.1.0.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1c00d007d957771e8479f8b86f32071dc973d5fe537f86c0456005771eb4751
|
|
BLAKE2b-256 checksum How to use checksums |
eed1dfe2a5e1c6cc00ab929d4cbda4424f1cb97bc80001d72b61aca6d23f1ed1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux Asahi Remix","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / quotish-0.1.0-py3-none-any.whl
| Download URL | quotish-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6e1e2daa0145ccae5ef135bc3aefd4b6e8a30ec1b1292c7b62b5ee735879fb8
|
|
BLAKE2b-256 checksum How to use checksums |
220c3fcc6e46e58440ae16810f51bb2d66ed8863e08e67dd583443f0b0483cf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux Asahi Remix","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|