Skip to main content

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\SrpV2\Exe',
...     value='EnforcementMode',
...     type='REG_DWORD',
...     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
...     ]
... )

Metadata

Release files for registrypol 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for registrypol 1.0.1
File Size Uploaded
registrypol-1.0.1.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for registrypol 1.0.1
File Interpreter ABI Platform
registrypol-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / registrypol-1.0.1.tar.gz

Download URL registrypol-1.0.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c32d038b7c55a11e71edc684738b61bc10ebc03b253fc543c1f085d644ae0e8e
BLAKE2b-256 checksum
How to use checksums
89665f77d9cc5548824218267293dee01dd970ea641e43f97737e4a2dd51bc09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / registrypol-1.0.1-py3-none-any.whl

Download URL registrypol-1.0.1-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05167a95bff085e6c39c20202102ff74555a9a7b839336b4b1f740cb8d6b17e2
BLAKE2b-256 checksum
How to use checksums
7882deb59d13fb9c58ba5e236cb1c17406ecfb36f50eae8824a8b1a79f7f3fa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page