Skip to main content

Context manager for Windows Registry manipulations

Project description

winregmgr

PyPI

Helper library that allows to read/write from/to Windows Registry via simplified syntax of Python contextmanager.

Install:

$ pip install winregmgr

Usage Samples:

from winregmgr.winreg_manager import OpenKey
import winreg   # for accessing constants

# Read parameter from Registry:
with OpenKey(winreg.HKEY_CURRENT_USER, r"SOFTWARE\ODBC\ODBC.INI\MS Access Database\\") as reg_key:
  value = reg_key.get_value("Driver")

# If parameter is read only - optional access type has to be explicitly set:
with OpenKey(winreg.HKEY_LOCAL_MACHINE, "Read Only Path", access=winreg.KEY_READ) as reg_key:
  value = reg_key.get_value("Driver")

# Read all parameters under given path into dictionary
with OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\\") as reg_key:
  values = reg_key.get_values()

# Write Parameter if path does not exist - creates it
with OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\\") as reg_key:
  reg_key.set_value("Parameter", "Its value")

# Delete Parameter
with OpenKey(winreg.HKEY_CURRENT_USER, r"PATH\TO\PARAMETER\\") as reg_key:
  reg_key.delete_value("Parameter")

Project details


Download files

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

Source Distribution

winregmgr-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

winregmgr-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file winregmgr-0.1.0.tar.gz.

File metadata

  • Download URL: winregmgr-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for winregmgr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dfe89cb4676960bb7a5d64a7a061fab1fdb9a3069f415bae9847f4e3e94ab086
MD5 91b45b614cee7019af864c91e026b755
BLAKE2b-256 e71508ea735b3ad377859b6644a880494fe79a33f5a1147f4c79e5ad559c3315

See more details on using hashes here.

File details

Details for the file winregmgr-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: winregmgr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for winregmgr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e880b116ce94d61ec8d468b1e7d10b4079e2dc7bab8f30f1333f07a6ba72a7a0
MD5 0385dc7a52b323794113f05f16456efd
BLAKE2b-256 114065bca0781969bfc5357a8b29e92243cfa459c6116ed8cf8f5872df07aba1

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