Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
A Python library for interacting with the Windows registry
Install via PyPI:
pip install winregistry
import winreg
from winregistry import open_key
# Create a registry key
with open_key(
winreg.HKEY_LOCAL_MACHINE,
sub_key="SOFTWARE\\MyApp",
sub_key_ensure=True,
sub_key_access=winreg.KEY_WRITE
) as key:
print("Registry key created")
# Delete a registry key
with open_key(
winreg.HKEY_LOCAL_MACHINE,
sub_key="SOFTWARE",
sub_key_access=winreg.KEY_WRITE
) as key:
key.delete_key("MyApp")
print("Registry key deleted")
from winregistry import open_key, open_value
# Set a registry value
with open_key(
"HKLM\\SOFTWARE\\MyApp",
sub_key_ensure=True,
sub_key_access=winreg.KEY_SET_VALUE
) as key:
key.set_value("MyValue", "Sample Data", winreg.REG_SZ)
print("Registry value set")
# Read a registry value
with open_value(
"HKLM\\SOFTWARE\\MyApp",
value_name="MyValue"
) as value:
print(f"Registry value: {value.data}")
from winregistry import open_key
# Enumerate subkeys
with open_key(
"HKLM\\SOFTWARE",
sub_key_access=winreg.KEY_READ
) as key:
subkeys = key.enum_subkeys()
print(f"Subkeys: {subkeys}")
# Enumerate values
with open_key(
"HKLM\\SOFTWARE\\MyApp",
sub_key_access=winreg.KEY_READ
) as key:
values = key.enum_values()
print(f"Values: {values}")
https://shpaker.github.io/winregistry/winregistry.robot
*** Variables ***
${ SUITE_KEY_NAME } HKLM\\SOFTWARE\\_ROBOT_TESTS_
${ SHORT_CASE_KEY_NAME } _CASE_KEY_
${ CASE_KEY_NAME } ${ SUITE_KEY_NAME }\\${ SHORT_CASE_KEY_NAME }
${ VALUE_NAME } some_testing_value
*** Settings ***
Library Collections
Library winregistry.robot
Suite Setup Create Registry Key ${ SUITE_KEY_NAME }
Suite Teardown Delete Registry Key ${ SUITE_KEY_NAME }
*** Test Cases ***
TEST REGISTRY KEYS
[Teardown] Delete Registry Key ${ CASE_KEY_NAME }
${ items } = Get Registry Key Sub Keys ${ SUITE_KEY_NAME }
List Should Not Contain Value ${ items } ${ SHORT_CASE_KEY_NAME }
Registry Key Should Not Exist ${ CASE_KEY_NAME }
Create Registry Key ${ CASE_KEY_NAME }
Registry Key Should Exist ${ CASE_KEY_NAME }
${ items } = Get Registry Key Sub Keys ${ SUITE_KEY_NAME }
List Should Contain Value ${ items } ${ SHORT_CASE_KEY_NAME }
TEST REGISTRY VALUES
[Setup] Create Registry Key ${ CASE_KEY_NAME }
[Teardown] Delete Registry Key ${ CASE_KEY_NAME }
${ items } = Get Registry Key Values Names ${ CASE_KEY_NAME }
List Should Not Contain Value ${ items } ${ VALUE_NAME }
Registry Value Should Not Exist ${ CASE_KEY_NAME } ${ VALUE_NAME }
Create Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME } SZ
Registry Value Should Exist ${ CASE_KEY_NAME } ${ VALUE_NAME }
${ items } = Get Registry Key Values Names ${ CASE_KEY_NAME }
List Should Contain Value ${ items } ${ VALUE_NAME }
${ value } = Read Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME }
Should Be Equal ${ value.data } ${ EMPTY }
Set Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME } Remove me!
${ value } = Read Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME }
Should Be Equal ${ value.data } Remove me!
Delete Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME }
Contributions are welcome! Please read our contributing guidelines for more details.
We use poetry
for dependency management and packaging. To set up your development environment, follow these steps:
Install poetry
if you haven't already:
pip install poetry
Install the project dependencies:
poetry install --sync
We use ruff
for code formatting and linting. The following tasks are defined in the Justfile
to help with these processes:
Format the code:
just fmt
Run the linter:
just lint
This project is licensed under the MIT License.
FAQs
A Python library for interacting with the Windows registry
We found that winregistry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.