Skip to main content

Convenience functions for constructing shell commands

Latest release 20210316: Minor doc update.

Functions for safely constructing shell command lines from bare strings. Somewhat like the inverse of the shlex stdlib module.

As of Python 3.3 the function shlex.quote() does what quotestr() does.

As of Python 3.8 the function shlex.join() does what quotecmd() does.

Function main_shqstr(argv=None)

shqstr: emit shell-quoted form of the command line arguments.

Function quote(args)

Quote the supplied strings, return a list of the quoted strings.

As of Python 3.8 the function shlex.join() is available for this.

Function quotecmd(argv)

Quote strings, assemble into command string.

Function quotestr(s)

Quote a string for use on a shell command line.

As of Python 3.3 the function shlex.quote() is available for this.

Release Log

Release 20210316: Minor doc update.

Release 20180613: Rework quotestr significantly to provide somewhat friendlier quoting, include "," in the SAFECHARS.

Release 20170903.2: bugfix main boilerplate after setuptools workaround

Release 20170903.1: workaround setuptool's slightly dumb console_scripts call of a "main" function

Release 20170903: shqstr command; new quotecmd(argv) function

Release 20150118: Extend SAFECHARS to include colon.

Release 20150111: minor cleanup

Release 20150107: initial standalone public release

Metadata

Release files for cs-sh 20210316

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cs-sh 20210316
File Size Uploaded Provenance Actions
cs.sh-20210316.tar.gz 3.4 kB Without provenance Details for cs.sh-20210316.tar.gz

Release files / cs.sh-20210316.tar.gz

Download URL cs.sh-20210316.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
27bf548a6452f21ef3717567b332843ce83e1c3decc451645d1326a2dcb6f435
BLAKE2b-256 checksum
How to use checksums
b18334cac28f2babcb72f76fdef51337b185a91b95093e6370658d239c355356
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.2

Security for cs-sh 20210316

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page