Skip to main content

POSIX parameter expansion in Python

Project description

POSIX Parameter Expansion

GitHub PyPI PyPI - Python Version PyPI - Wheel PyPI - Downloads

Tests CodeQL pre-commit

This is an experiment to create a Python library to enable POSIX parameter expansion from a string.

Obvious Test Cases

    >>> from parameter_expansion import expand
    >>> foo = 'abc/123-def.ghi'
    >>> # Bland Expansion
    >>> expand('abc $foo abc')
    'abc abc/123-def.ghi abc'
    >>> expand('abc${foo}abc')
    'abcabc/123-def.ghiabc'
    >>>
    >>> # Default Value Expansion
    >>> expand('-${foo:-bar}-')
    '-abc/123-def.ghi-'
    >>> expand('-${bar:-bar}-')
    '-bar-'

Default Value Expansion

    >>> foo = 'abc/123-def.ghi'
    >>> expand('abc $foo abc')
    'abc abc/123-def.ghi abc'
    >>> expand('abc${foo}abc')
    'abcabc/123-def.ghiabc'

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

parameter-expansion-0.2.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

parameter_expansion-0.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file parameter-expansion-0.2.0.tar.gz.

File metadata

  • Download URL: parameter-expansion-0.2.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.0 Darwin/20.5.0

File hashes

Hashes for parameter-expansion-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2ec886a657d3ee49e40d68574b1a5390318071b0c7208daf9f1143eee26511ab
MD5 80f5e39e7caf30e35a96aceaccaf66af
BLAKE2b-256 4ff3f629b31fdac9ffd7c79339eac22f0449a42e6ea53e57bea019806e2be177

See more details on using hashes here.

File details

Details for the file parameter_expansion-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for parameter_expansion-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40d33a6e892dca848ccb930167acec45859fe6965dd1058493e174ddcd8496ae
MD5 3f63a19f88d07028695702b053ce24e0
BLAKE2b-256 e799977fb7a03ba78d64de658707df1c52df8d85a965208ae5a80a5a3d4c6c3f

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