Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
[![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)

A Python library for interacting with the Windows registry. This library provides a simple and intuitive API for performing common registry operations, making it easier to work with the Windows registry in Python applications and automated tests.
A Python library for interacting with the Windows registry.

**Windows only.** This library depends on the standard library module `winreg`, which is available only on Windows. On Linux or macOS you will get `ModuleNotFoundError: No module named 'winreg'`; use Windows or guard usage with a platform check (e.g. `if sys.platform == "win32"`). This library provides a simple and intuitive API for performing common registry operations, making it easier to work with the Windows registry in Python applications and automated tests.

## Installation

Expand Down
11 changes: 10 additions & 1 deletion winregistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
URL: https://github.com/shpaker/winregistry
"""

import winreg
import sys

try:
import winreg
except ImportError as e:
raise ImportError(
"winregistry requires Windows. The 'winreg' module is part of the Python "
"standard library only on Windows. Current platform: {!r}".format(sys.platform)
) from e

from abc import ABC, abstractmethod
from collections import namedtuple
from contextlib import contextmanager
Expand Down