Skip to main content

Bash range expression evaluator for your cli application

Project description

# bashrange

Bash range expression evaluator for your cli application

# Install

`bash pip install bashrange `

# Use

Import and call expand_args

`python import argparse from bashrange import expand_args parser = argparse.ArgumentParser(prog="copy.py") parser.add_argument("src", nargs='+') parser.add_argument("dst") args = parser.parse_args(expand_args()) `

And you can use bash range and list expressions outiside bash shell, for example in cmd on windows

`bash python copy.py image{1..10}.jpg folder python copy.py file.txt{,.bak} `

You can test expression expansion in cmd like this

`bash python -m bashrange -v {1..10..2} `

## Author

Stanislav Doronin <mugisbrows@gmail.com>

## License

bashrange is distributed under the terms of MIT license, check LICENSE file.

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

bashrange-0.0.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

bashrange-0.0.4-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file bashrange-0.0.4.tar.gz.

File metadata

  • Download URL: bashrange-0.0.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for bashrange-0.0.4.tar.gz
Algorithm Hash digest
SHA256 0895c434d307f554a9114cbf1ade18dfe7d8ea5a1c773cc6b415c1de97ea896b
MD5 672d98f12db24246df7c5be9d2bddb21
BLAKE2b-256 dd41c9bfbe4e8aa4717d45bdf098b959d3d342d320c2ce72d5122f114a920f70

See more details on using hashes here.

File details

Details for the file bashrange-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: bashrange-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for bashrange-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0be689f1129baf8536a6c0630be70a9d27ec7a2e11b18e8457775242ee22c553
MD5 27da24f56e9f79b0b4a382ab4a5bc0f0
BLAKE2b-256 037e73140a55bde073215b40ab7fd3f238c036844a0235dcf470a853e42ac278

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