Skip to main content

Parse line as shell words.

Project description

Build Coverage PyPI version

Parse line as shell words.

Usage

>>> from shellwords import ShellWords
>>> s = ShellWords()
>>> s.parse("./foo --bar=baz")
[u'./foo', u'--bar=baz']
>>> s.parse('./foo --bar=baz foobar')
[u'./foo', u'--bar=baz', u'foobar']
>>> os.environ['FOO'] = 'bar'
>>> s = ShellWords(parse_env=True)
>>> s.parse("./foo $FOO")
[u'./foo', u'bar']
>>> s = ShellWords(parse_backtick=True)
>>> s.parse("./foo `echo $SHELL`")
[u'./foo', u'/bin/bash']

Thanks

This is based on go-shellwords package.

Changelog

0.1.0 (2015-01-29)

  • Initial Release

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

shellwords-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

shellwords-0.1.0-py2.py3-none-any.whl (4.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file shellwords-0.1.0.tar.gz.

File metadata

  • Download URL: shellwords-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for shellwords-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7dac53f0cfe779f4dbfdd86b1ea6ac924a7588b56123ae1f9eda7a5686fa3576
MD5 1135f64a1b661adb58add7ede1623c69
BLAKE2b-256 eaf8cd4ce7a8207cdc5bb9c40ee0bde4ed270887de584006535e44856ef4efc5

See more details on using hashes here.

File details

Details for the file shellwords-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for shellwords-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 18ca58eccc16de3540e2889f9badd67d92a6edced64ffb760cfd12ccca598bef
MD5 922fac43197c9f3763f9189663e65745
BLAKE2b-256 caf756e15b30d1dd33488ffed1ba7c0cdaf38089eae06f38e0c8920a0d45f1db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page