Name | reg_query JSON |
Version |
0.1.1
JSON |
| download |
home_page | https://github.com/th-yoo/reg_query |
Summary | `reg_query` is a Python library for querying the Windows Registry to find specified values and keys efficiently. |
upload_time | 2024-10-04 06:33:12 |
maintainer | None |
docs_url | None |
author | th yoo |
requires_python | <4.0,>=3.9 |
license | MIT |
keywords |
registry
win32
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# reg\_query
**reg_query** is a Python library for querying the Windows Registry to find specified values and keys efficiently.
## Installation
```powershell
PS > pip install reg_query
```
## Usage
### Find 7-Zip Install Location from the Registry
This example demonstrates how to find the install location of 7-Zip by querying the Windows Registry.
```python
import winreg
from typing import Callable, Any, Tuple
from reg_query import traverse
def match_displayname(app_name: str) -> Callable[[Any], Tuple[bool, Any]]:
"""Matcher function to find the install location based on display name."""
def matcher(subkey):
value, _ = winreg.QueryValueEx(subkey, "DisplayName")
if app_name.lower() in value.lower():
iloc, _ = winreg.QueryValueEx(subkey, 'InstallLocation')
return True, iloc
return False, None
return matcher
# Specify the registry path for installed applications
reg_path = r'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
# Traverse the registry using the matcher
result = traverse(reg_path, match_displayname('7-Zip'))
if result:
print(f"Found: {result}")
else:
print("Not found.")
```
## License
This project is licensed under the MIT License. See the LICENSE file for details.
## Contact
For any questions or support, please reach out to me via [GitHub Issues](https://github.com/th-yoo/reg_query/issues).
Raw data
{
"_id": null,
"home_page": "https://github.com/th-yoo/reg_query",
"name": "reg_query",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "registry, win32",
"author": "th yoo",
"author_email": "taihyungyoo@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/68/74/c129b77e3c792571b1b1e41edb0a2c68b185285f6a553b81561488de2fd6/reg_query-0.1.1.tar.gz",
"platform": null,
"description": "# reg\\_query\n**reg_query** is a Python library for querying the Windows Registry to find specified values and keys efficiently.\n\n## Installation\n```powershell\nPS > pip install reg_query\n```\n\n## Usage\n### Find 7-Zip Install Location from the Registry\nThis example demonstrates how to find the install location of 7-Zip by querying the Windows Registry.\n\n```python\nimport winreg\nfrom typing import Callable, Any, Tuple\nfrom reg_query import traverse\n\ndef match_displayname(app_name: str) -> Callable[[Any], Tuple[bool, Any]]:\n \"\"\"Matcher function to find the install location based on display name.\"\"\"\n def matcher(subkey):\n value, _ = winreg.QueryValueEx(subkey, \"DisplayName\")\n if app_name.lower() in value.lower():\n \tiloc, _ = winreg.QueryValueEx(subkey, 'InstallLocation')\n \treturn True, iloc\n return False, None\n return matcher\n\n# Specify the registry path for installed applications\nreg_path = r'HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall'\n\n# Traverse the registry using the matcher\nresult = traverse(reg_path, match_displayname('7-Zip'))\n\nif result:\n print(f\"Found: {result}\")\nelse:\n print(\"Not found.\")\n```\n## License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Contact\nFor any questions or support, please reach out to me via [GitHub Issues](https://github.com/th-yoo/reg_query/issues).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "`reg_query` is a Python library for querying the Windows Registry to find specified values and keys efficiently.",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/th-yoo/reg_query"
},
"split_keywords": [
"registry",
" win32"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2767aa01f0e5a95d170b561db6e137adc5894a9ebe43d32de945280d46001488",
"md5": "7018b8c1565eda31d385d6bd4debf899",
"sha256": "2e9cd09a67185f3d77491a00ad9c20972f751c8b645f8e14002c7fbe511c2ba3"
},
"downloads": -1,
"filename": "reg_query-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7018b8c1565eda31d385d6bd4debf899",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 3721,
"upload_time": "2024-10-04T06:33:11",
"upload_time_iso_8601": "2024-10-04T06:33:11.765229Z",
"url": "https://files.pythonhosted.org/packages/27/67/aa01f0e5a95d170b561db6e137adc5894a9ebe43d32de945280d46001488/reg_query-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6874c129b77e3c792571b1b1e41edb0a2c68b185285f6a553b81561488de2fd6",
"md5": "2fae912bf90950227e1529c0dc1b49c2",
"sha256": "83d6002d68ee82773d6842226f56db004c2c0087a49d37e8711c7e81f1f551a5"
},
"downloads": -1,
"filename": "reg_query-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "2fae912bf90950227e1529c0dc1b49c2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 2969,
"upload_time": "2024-10-04T06:33:12",
"upload_time_iso_8601": "2024-10-04T06:33:12.799474Z",
"url": "https://files.pythonhosted.org/packages/68/74/c129b77e3c792571b1b1e41edb0a2c68b185285f6a553b81561488de2fd6/reg_query-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-04 06:33:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "th-yoo",
"github_project": "reg_query",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "reg_query"
}