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 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.1.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.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: winregmgr-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f0eda807996b6b099082cba5043860b411a28f6396d53cdb84f23df053e0e1b8
MD5 08cc473a3c30cd820ce349cdee27dd4b
BLAKE2b-256 060bde340e6101ca246c10a63a8df6ea6f022f93417d4090f8699ad6dafda5e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: winregmgr-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9942e85da0ade293c85ac0ffc348750d2f728149bca01405917bf4479b52b15
MD5 c133b462cdb6df2a79c99b7a2c9f89a9
BLAKE2b-256 b73112fc565d617e435ded1b4ab5af5a97d5b5071f9407df8802ea5e1cf27ea3

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