Skip to main content

Access and edit all environment variables

Project description

win_env 1.0.1

This is a library that allows you to display and set Windows system environment variables and user environment variables.

Description

This module uses the winreg module to edit the location of environment variables.

Usage

env_type

win_env.user

Specifies the user environment variables.

win_env.systems

Specifies the system environment variables.

win_env.volatile (beta)

Specifies a volatile environment variable. There seems to be a bug in Windows so it may not work properly.

write_mode

1

Write it in REG_SZ format, not in list format, which indicates that you haven't specified a location.

2

Specify 2 to specify location or list format, written as REG_EXPAND_SZ.

command

win_env.lists(env_type)

Lists the contents of the environment variables.

win_env.get(env_type, key)

Displays the contents of the environment variable named key.

win_env.set(env_type, key, value, write_mode)

Write the environment variables.

Note: Run as administrator to write system environment variables.

win_env.all_list()

Returns all environment variables as a dictionary+list.

win_env.dels(env_type, key)

Removes an environment variable. Returns Env NotFoundError of the environment variable does not exist.

Note: Admin privileges are required for system environment variables.

win_env.add(env_type, key, value, write_mode)

Adds the environment variable if it doesn't exist, raises an EnvError if it does exist.

How to install

Run

pip install git+https://github.com/akino11/win_env.git

in the command prompt.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

win_all_env-1.0.3-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

Details for the file win_all_env-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: win_all_env-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 35.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for win_all_env-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1dbcc45f0a8740aa030cedd5509327a33fd0f9bb1f20cffbfacced268c47838b
MD5 a685a6601090bb7d3d0886a353c618b7
BLAKE2b-256 079d41e1ab9bad1eab4298b0b85ac503ac5773cd2a8eb64c86c23f8cf4d368f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page