Skip to main content

shellvars-py

Read environment variables defined in a shell script into Python. This library uses the shell to get variable values, and handles multiline variables.

# Usage

Given a shell file: myvars.env:

`shell #!/bin/bash export VAR1=1 export VAR2="This is a multiline value" export VAR3=3 NOT_EXPORTED=4 `

## get_vars

`python >>> import shellvars >>> shellvars.get_vars('myvars.env') {'VAR1': '1', 'VAR2': 'This\nis\na\nmultiline value', 'VAR3': '3' } `

## list_vars Lists the variable names in the script. `python >>> import shellvars >>> shellvars.list_vars('myvars.env') ['VAR1', 'VAR2', 'VAR3'] `

This is equivalent to, but faster than `python >>> shellvars.get_vars('myvars.env').keys() `

Release files for shellvars-py 0.1.2

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

Source distribution (sdist)

Source distribution for shellvars-py 0.1.2
File Size Uploaded
shellvars-py-0.1.2.tar.gz 2.5 kB Details

Release files / shellvars-py-0.1.2.tar.gz

Download URL shellvars-py-0.1.2.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
81d81e188129ad571ade763fa484522302eb78806b0eece4ed11b8115a295729
BLAKE2b-256 checksum
How to use checksums
3a375f72c2aea402cd2dd1bf05c1eeee4fd089e22c51d279e0579f65f36faf44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

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