pshlex - join various stringifiable objects and quote them for the shell
[Home | GitLab | PyPI | Download | ReadTheDocs]
Overview
This library was written mainly to provide a function that can stringify
a list of path-like objects: the [join()][pshlex.join] function is very similar to
shlex.join(), but it will accept pathlib.Path objects
as well as strings.
The [join_any()][pshlex.join_any] function started off as an implementation detail, but
it may turn out to be useful in its own right; it is also similar to
shlex.join(), but it will convert any Python object into its string
representation.
Examples
Use the [join()][pshlex.join] function as a type-safe version when dealing with
path-like objects:
def run(cmd: list[str | pathlib.Path]) -> None:
"""Run a command."""
cmdstr: Final = pshlex.join(cmd)
...
sys.exit(f"Could not run `{cmdstr}`: {err}")
Contact
The pshlex library was written by Peter Pentchev.
It is developed in a GitLab repository.
This documentation is hosted at Ringlet with a copy at ReadTheDocs.
Metadata
Release files for pshlex 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pshlex-0.1.1.tar.gz | 72.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pshlex-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 76.4 kB
Release files / pshlex-0.1.1.tar.gz
| Download URL | pshlex-0.1.1.tar.gz |
|---|---|
| Size | 72.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
980e9db476e9189e2b3c7943ec896fa2951985ad724d34d5a07860da0b60b2e0
|
|
BLAKE2b-256 checksum How to use checksums |
4dcae0565ec810a61a773e3bff7d05561481b87ec5db554ad7bdf19ac8cf8421
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / pshlex-0.1.1-py3-none-any.whl
| Download URL | pshlex-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd8906c37d57cbadf6bc1f8a429c3eec8c03565ed76fcc3314e46b5f8f9cb01e
|
|
BLAKE2b-256 checksum How to use checksums |
6bc2811c28ec25fc28d72cd92ee462cd258590451863842672a3a54bfa9ac626
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|