Skip to main content

Library aimed at working with Windows registry

Project description

WinRegistry

PyPI PyPI

Python package aimed at working with Windows Registry

Installation

Install via PyPI:

pip install winregistry

Usage

import winreg

from winregistry import connect_registry

_SUB_KEY_NAME = "SOFTWARE\_REMOVE_ME_"


# connect to registry
with connect_registry(winreg.HKEY_LOCAL_MACHINE) as hklm:
  
  # create registry key
  hklm.create_key(_SUB_KEY_NAME)
  
  # open registry subkey
  with hklm.open_key(_SUB_KEY_NAME) as subkey:
    
    # set value to subkey
    subkey.set_value("remove_me", winreg.REG_SZ, "Remove me!")
    
    # read value
    value = subkey.read_value("remove_me")
    
    # change data of value
    value.data = "Don't forget remove me!"
    
    # delete value in subkey
    hklm.delete_key(_SUB_KEY_NAME)

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

winregistry-2.0.0a2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

winregistry-2.0.0a2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file winregistry-2.0.0a2.tar.gz.

File metadata

  • Download URL: winregistry-2.0.0a2.tar.gz
  • Upload date:
  • Size: 4.5 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

Hashes for winregistry-2.0.0a2.tar.gz
Algorithm Hash digest
SHA256 16498a8a5f13688731e7402cfc78121e8800728ce4266f5fca8fb325235af8d4
MD5 d0f6e915d64f0765e44271eb70acdcc3
BLAKE2b-256 5984ac38e560b070a5572779f5404c51f4484d0b2b99008016e54164d1832e14

See more details on using hashes here.

File details

Details for the file winregistry-2.0.0a2-py3-none-any.whl.

File metadata

  • Download URL: winregistry-2.0.0a2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 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

Hashes for winregistry-2.0.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c7979befeac09f18d08eed32c581ff584a46e3b7726c51ab17b7d42fb96f08e
MD5 01d74019543217dce4d8cd7306e8bc63
BLAKE2b-256 bf4d6e8cf6a36e84ad5ff6f5a9da917c514c6595179dfcc24f119d7bf1106d2d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page