Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shpaker/winregistry
Tiny Python library aimed at working with Windows Registry
https://github.com/shpaker/winregistry
python regedit registry robotframework testing windows winreg
Last synced: 29 days ago
JSON representation
Tiny Python library aimed at working with Windows Registry
- Host: GitHub
- URL: https://github.com/shpaker/winregistry
- Owner: shpaker
- License: mit
- Created: 2017-04-03T17:17:54.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-02-17T19:14:34.000Z (9 months ago)
- Last Synced: 2024-10-03T12:13:12.963Z (about 1 month ago)
- Topics: python, regedit, registry, robotframework, testing, windows, winreg
- Language: Python
- Homepage:
- Size: 81.1 KB
- Stars: 20
- Watchers: 4
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# WinRegistry
[![PyPI](https://img.shields.io/pypi/v/winregistry.svg)](https://pypi.python.org/pypi/winregistry)
[![PyPI](https://img.shields.io/pypi/dm/winregistry.svg)](https://pypi.python.org/pypi/winregistry)Minimalist Python library aimed at working with Windows Registry.
## Installation
```bash
pip install winregistry
```## Usage
```py
from winregistry import WinRegistryTEST_REG_PATH = r"HKLM\SOFTWARE\_REMOVE_ME_"
if __name__ == "__main__":
with WinRegistry() as client:
client.create_key(TEST_REG_PATH)
client.write_entry(TEST_REG_PATH, "remove_me", "test")
test_entry = client.read_entry(TEST_REG_PATH, "remove_me")
assert test_entry.value == "test"
client.delete_entry(TEST_REG_PATH, "remove_me")
```Usage with ``Robot Testing Framework`` Library
----------------------------------------------```
*** Settings ***
Library winregistry.robot*** Test Cases ***
Valid Login
${path} = Set Variable HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run
Write Registry Entry ${path} Notepad notepad.exe
${autorun} = Read Registry Key ${path}
Delete Registry Entry ${path} Notepad
```