Windows Registry Policy parser and emitter for Python
Project description
RegistryPol
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
... ]
... )
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file registrypol-1.0.1.tar.gz.
File metadata
- Download URL: registrypol-1.0.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c32d038b7c55a11e71edc684738b61bc10ebc03b253fc543c1f085d644ae0e8e
|
|
| MD5 |
a074b6c88cac3fc9ea9f9095998d589d
|
|
| BLAKE2b-256 |
89665f77d9cc5548824218267293dee01dd970ea641e43f97737e4a2dd51bc09
|
File details
Details for the file registrypol-1.0.1-py3-none-any.whl.
File metadata
- Download URL: registrypol-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05167a95bff085e6c39c20202102ff74555a9a7b839336b4b1f740cb8d6b17e2
|
|
| MD5 |
969fcdf5f7ff99acf46fba4c1611b89b
|
|
| BLAKE2b-256 |
7882deb59d13fb9c58ba5e236cb1c17406ecfb36f50eae8824a8b1a79f7f3fa2
|