Cross platform(ish) productivity commands written in python.
Project description
setenvironment
Cross platform way to set system environment variables and paths that are persistant across reboots.
> pip install setenvironment
> setenviroment_set foo bar
> setenvironment_get foo
> setenviroment_unset foo
> setenviroment_addpath /my/path
> setenviroment_removepath /my/path
# or use custom config file
> setenvironment_set foo bar --config-file ~/.bash_profile
# or set using an environment setting
> export SETENVIRONMENT_CONFIG_FILE = ~/.bash_profile
> setenviroment_set foo bar
from setenvironment import set_env_var, add_env_path, unset_env_var, remove_env_path, set_config_file
# by default, ~/.bashrc is used
set_env_var("FOO", "BAR")
get_env_var("FOO") # returns BAR
add_env_path("MYPATH")
unset_env_var("FOO")
remove_env_path("MYPATH")
# use ~/.bash_profile instead (no op on Windows)
set_config_file("~/.bash_profile")
set_env_var("FOO", "BAR")
add_env_path("MYPATH")
unset_env_var("FOO")
remove_env_path("MYPATH")
When setting variables this tool will:
- unix/macos
- export the variable (so you can source the script)
- set the os.environ to the proper value
- write the value to the .bashrc file (make sure it's chmod +w)
- win32
- writes to the registery
- broadcasts the new value (cmd.exe ignores this though) to all available processes
- paths like
/my/path
will be converted to\\my\\path
Release Notes
- 1.0.3: Fix relative links in badges to be absolute when uploaded to pypi
- 1.0.2: Fix badges on pypi
- 1.0.1: Adds setenvironment_get
- 1.0.0: Initial release
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
setenvironment-1.0.3.tar.gz
(13.4 kB
view hashes)
Built Distribution
Close
Hashes for setenvironment-1.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b179a66d123d8052689f8a91e49862fa48e50a7e34b986aa994ede61993673eb |
|
MD5 | bc505cc0d68390a02ae0f01ff189f97a |
|
BLAKE2b-256 | f4374eb00e0d183a0a61d2f50983c1f7685ea06c137586d83073ab2de73cc2f3 |