Skip to main content

cmdvars

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:

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

get_vars

>>> 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.

>>> import shellvars
>>> shellvars.list_vars('myvars.env')
['VAR1', 'VAR2', 'VAR3']

This is equivalent to, but faster than

>>> shellvars.get_vars('myvars.env').keys()

Metadata

Release files for cmdvars 0.1.3

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

Source distribution (sdist)

Source distribution for cmdvars 0.1.3
File Size Uploaded Provenance Actions
cmdvars-0.1.3.tar.gz 19.0 kB Without provenance Details for cmdvars-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cmdvars 0.1.3
File Interpreter ABI Platform Actions
cmdvars-0.1.3-py2.py3-none-any.whl Python 3, Python 2 none any Details for cmdvars-0.1.3-py2.py3-none-any.whl

Total release size: 24.0 kB

Release files / cmdvars-0.1.3.tar.gz

Download URL cmdvars-0.1.3.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
97a14000d66eccf51c30fefa6241eadae825390d5f4d4420f0ada1a5a429e5b1
BLAKE2b-256 checksum
How to use checksums
84c0ff5d9364e11d46c10e67bcde69ab1918ab09cea5c1c2480936bdd7d1e39c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / cmdvars-0.1.3-py2.py3-none-any.whl

Download URL cmdvars-0.1.3-py2.py3-none-any.whl
Size 5.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
99f1da66c5d1beae73b933f841d95fc59cb78884a4e14f5fdec4f03bdc6c5be9
BLAKE2b-256 checksum
How to use checksums
c462947f816007282854f69b6a5cd000bfc1edd29957dadc43fbd23591d305fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for cmdvars 0.1.3

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.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

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