Skip to main content

Windows Registry Policy parser and emitter for Python

Project description

RegistryPol

GitHub Workflow Status (branch) PyPI GitHub

The registrypol module allows you to easily parse and create Windows Registry Policy files in Python.

Installation

To install the registrypol module via pip, run the command:

$ pip install registrypol

Usage

Start by importing the registrypol module.

>>> import registrypol

The function registrypol.load, loads an registry policy file.

>>> with open('registry.pol', 'rb') as file:
...     registrypol.load(file)

In addition to loading an existing registry policy, policies created using the relevant Values can be dumped to a file using the registrypol.dump function.

>>> with open('registry.pol', 'wb') as file:
...     registrypol.dump(policy, file)

RegistryValue

To create a registry value as part of an registry policy, a registrypol.values.RegistryValue must be created.

>>> from registrypol.values import RegistryValue

>>> value = RegistryValue(
...     key='Software\Policies\Microsoft\Windows\Control Panel\Desktop',
...     value='ScreenSaverIsSecure',
...     type='REG_SZ',
...     size=4,
...     data=b'\x01\x00\x00\x00'
... )

RegistryPolicy

To create an registry policy one or more registry values must be created as described above.

These values can then be used to create an registrypol.policy.RegistryPolicy.

>>> from registrypol.policy import RegistryPolicy

>>> policy = RegistryPolicy(
...     values=[
...         value
...     ]
... )

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

registrypol-1.0.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

registrypol-1.0.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file registrypol-1.0.0.tar.gz.

File metadata

  • Download URL: registrypol-1.0.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for registrypol-1.0.0.tar.gz
Algorithm Hash digest
SHA256 98410c6a76ce5340f9b4af1c17bb94d9fb2ced985e329b6a3b4db2af4bc91221
MD5 6a65acbeb182db0f9d3b21bf9faa1882
BLAKE2b-256 1447e072246bc92f23e970fb438c14122fd2670b8cd9d87cd19591ca4b86a85a

See more details on using hashes here.

File details

Details for the file registrypol-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: registrypol-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for registrypol-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6197eeb1828718134e5320a7585d4370e5ac20c0aefbc582e33697eb5aed3a13
MD5 ef84fdd627930dd962f6fea5255e8015
BLAKE2b-256 47c9b5fd6e91c1b4bbefde8777e15c05d4a0e3ddecfbf5b9318a5e34e439a0e6

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