Skip to main content

Some environment related functions.

Project description

Some environment related functions.

  • LOGDIR, VARRUN, FLAGDIR: lambdas defining standard places used in other modules

  • envsub: replace substrings of the form '$var' with the value of 'var' from environ.

  • getenv: fetch environment value, optionally performing substitution

Function envsub(s, environ=None, default=None)

Replace substrings of the form '$var' with the value of 'var' from environ.


  • environ: environment mapping, default os.environ.
  • default: value to substitute for unknown vars; if default is None a ValueError is raised.

Function getenv(var, default=None, environ=None, dosub=False)

Fetch environment value.


  • var: name of variable to fetch.
  • default: default value if not present. If not specified or None, raise KeyError.
  • environ: environment mapping, default os.environ.
  • dosub: if true, use envsub() to perform environment variable substitution on default if it used. Default value is False.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cs.env, version 20190103
Filename, size File type Python version Upload date Hashes
Filename, size cs.env-20190103.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page