Library aimed at working with Windows registry
Project description
WinRegistry
Python library aimed at working with Windows Registry
Installation
pip install winregistry
Usage
import winreg
from winregistry import connect_registry
_SUB_KEY_NAME = "SOFTWARE\_REMOVE_ME_"
if __name__ == "__main__":
with connect_registry(winreg.HKEY_LOCAL_MACHINE) as hklm:
hklm.create_key(_SUB_KEY_NAME)
with hklm.open_key(_SUB_KEY_NAME) as subkey:
subkey.set_value("remove_me", winreg.REG_SZ, "Don't forget remove me!")
value = subkey.read_value("remove_me")
print(f"{value=}: {value.data}")
value.data = "remove me again!"
print(f"{value=}: {value.data}")
print(f"{list(subkey.values)=}")
subkey.delete_value("remove_me")
print(f"{list(subkey.values)=}")
hklm.delete_key(_SUB_KEY_NAME)
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
winregistry-2.0.0a1.tar.gz
(4.2 kB
view details)
Built Distribution
File details
Details for the file winregistry-2.0.0a1.tar.gz
.
File metadata
- Download URL: winregistry-2.0.0a1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1439d3d80e05b9915826ee566750078740144691d3d2ec7de60af5c97fa8c84 |
|
MD5 | a184a12709ed440f243d1c6224148c70 |
|
BLAKE2b-256 | 92af0189ccbc86400e64b08b4dce088e2d9afc49835f339d42d620b71406be1d |
File details
Details for the file winregistry-2.0.0a1-py3-none-any.whl
.
File metadata
- Download URL: winregistry-2.0.0a1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 896430dca579c3b1dd2e26c4e920b37f45b2f70cf972edf7969cce1326d4568f |
|
MD5 | c0a6909e2bac572f30fa687902bca834 |
|
BLAKE2b-256 | 94e0b9149813d98e936560bfb79cce24d4c04ac8398fd8b13f7473c315a29e84 |