Parse Python files and look for required environment variables
Project description
This is a small program which tries to guess what environment variables will be needed by other Python programs.
This tool should work on Python 2.7 and Python 3.3+
Usage
guessenv [-h] [-v] [-q] [-O] [-A] [-x EXCLUDE] [-X] files [files ...]
By default, guessenv will walk through all the files and directories specified on the command line, look for
patterns which seem to be searching for an environment variable, and print out all of the "required" environment
variables (those accessed through something akin to os.environ[...]
).
If invoked with the -O
argument, it will also print out optional environment variables (accessed through
os.getenv(...)
or os.environ.get(...)
.
If invoked with the -A
argument, it will exit non-zero if any "required" environment variables are not currently
present in the environment.
If invoked with the -v
argument, it will print more verbose information about where variables were found.
If invoked with the -q
argument, it will print nothing (unless -A
is also passed and any variables are missing)
The -x
and -X
arguments allow you to exclude files or directories when doing recursive searches.
License
This work is licensed under the ISC license, a copy of which can be found in LICENSE.txt.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file guessenv-0.2.tar.gz
.
File metadata
- Download URL: guessenv-0.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9945b9c5932c91527d974b6faed99bd55d820af63a70b364d4de563899cb52aa |
|
MD5 | 2c72549c646f66894551c0f679e295a2 |
|
BLAKE2b-256 | c3f9b0f7eaad496537c8dc0fe5e88d5e0d82babd1dd8ced1506795a8c0a83af2 |
File details
Details for the file guessenv-0.2-py3-none-any.whl
.
File metadata
- Download URL: guessenv-0.2-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87bcb50060ac89d89337e97776f1da7941f2ab3c7cbeb2708f575ac495fb61ba |
|
MD5 | 9e14919ba8ea5af0e7b1676906614cb9 |
|
BLAKE2b-256 | 4c4b2481503b0bc0b090979cb691cfb401cb1bb0ed38d4ec3d873a54d0ee133b |
File details
Details for the file guessenv-0.2-py2-none-any.whl
.
File metadata
- Download URL: guessenv-0.2-py2-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fb054160886161e4290503b69a4166cb89b6eeff90894d633b9de0f60bdfefa |
|
MD5 | 1ebb6782bd91c9a57bfb4e964bda2e84 |
|
BLAKE2b-256 | ff4593761ab3ab4c8744af95ffde878d98c57aefd3259e217dae46c6aaa37b0a |