{"id":14065036,"url":"https://github.com/williballenthin/python-registry","last_synced_at":"2025-05-15T14:08:44.003Z","repository":{"id":1494833,"uuid":"1746585","full_name":"williballenthin/python-registry","owner":"williballenthin","description":"Pure Python parser for Windows Registry hives.","archived":false,"fork":false,"pushed_at":"2025-01-27T15:02:00.000Z","size":2879,"stargazers_count":428,"open_issues_count":22,"forks_count":102,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-05-11T08:56:19.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/williballenthin.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.TXT","contributing":null,"funding":null,"license":"LICENSE.TXT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-05-14T05:16:19.000Z","updated_at":"2025-04-28T08:34:43.000Z","dependencies_parsed_at":"2025-04-04T17:13:19.265Z","dependency_job_id":null,"html_url":"https://github.com/williballenthin/python-registry","commit_stats":{"total_commits":291,"total_committers":29,"mean_commits":10.03448275862069,"dds":0.4914089347079038,"last_synced_commit":"fc75682ff70dfd8f576c4f4ed928b08fc806fc86"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williballenthin%2Fpython-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williballenthin%2Fpython-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williballenthin%2Fpython-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williballenthin%2Fpython-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/williballenthin","download_url":"https://codeload.github.com/williballenthin/python-registry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355335,"owners_count":22057354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:04:15.164Z","updated_at":"2025-05-15T14:08:38.985Z","avatar_url":"https://github.com/williballenthin.png","language":"Python","funding_links":[],"categories":["\u003ca id=\"b478e9a9a324c963da11437d18f04998\"\u003e\u003c/a\u003e工具","Python"],"sub_categories":["\u003ca id=\"920b69cea1fc334bbc21a957dd0d9f6f\"\u003e\u003c/a\u003e注册表"],"readme":"\npython-registry\n===============\n\nIntroduction\n------------\npython-registry is a pure Python library that provides read-only\naccess to Windows NT Registry files.\nThese include NTUSER.DAT, userdiff, and SAM. The interface is two-fold:\na high-level interface suitable for most tasks, and a low level\nset of parsing objects and methods which may be used for advanced\nstudy of the Windows NT Registry. This library is compatible with\nWindows,Linux, and MacOS, making it accessible and functional\nacross all major operating systems.\n\nUsage\n-----\n\nMost users will find the `Registry.Registry` module most appropriate.\nThe module exposes three classes: the `Registry`, the `RegistryKey`,\nand the `RegistryValue`. The `Registry` organizes parsing and access\nto the Windows Registry file. The `RegistryKey` is a convenient\ninterface into the tree-like structure of the Windows NT Registry.\nA `RegistryKey` may have children `RegistryKeys`, and may also have\nvalues associated with it. A `RegistryValue` can be thought of as\nthe tuple (name, datatype, value) associated with a `RegistryKey`.\npython-registry supports all major datatypes, such as `RegSZ`,\n`RegDWord`, and `RegBin`.\n\nTo open a Windows Registry file, its this easy:\n\n\n    import sys\n    from Registry import Registry\n    \n    reg = Registry.Registry(sys.argv[1])\n\n\nPrint all keys in a Registry\n\n\n    def rec(key, depth=0):\n        print \"\\t\" * depth + key.path()\n    \n        for subkey in key.subkeys():\n            rec(subkey, depth + 1)\n    \n    rec(reg.root())\n\n\nFind a key and print all string values\n\n\n    try:\n        key = reg.open(\"SOFTWARE\\\\Microsoft\\\\Windows\\\\Current Version\\\\Run\")\n    except Registry.RegistryKeyNotFoundException:\n        print \"Couldn't find Run key. Exiting...\"\n        sys.exit(-1)\n    \n    for value in [v for v in key.values() \\\n                       if v.value_type() == Registry.RegSZ or \\\n                          v.value_type() == Registry.RegExpandSZ]:\n        print \"%s: %s\" % (value.name(), value.value())\n\n\nAdvanced users who wish to study the structure of the Windows\nRegistry may find the `Registry.RegistryParse` module useful.\nThis module implements all known structures of the Windows Registry.\n\nWanted\n------\n  - Bug reports.\n  - Feedback.\n\npython-registry was originally developed to scratch one of\nthe author's itches.  Now he hopes it can be of use to\nsomeone outside of his lonely NYC apartment.\n\n\nLicense\n-------\nAs of version 0.2.0, python-registry is released under the Apache 2.0 license.\nBefore that, python-registry was released under the GPLv3.\n\n\nSources\n-------\nNearly all structure definitions used in python-registry\ncame from one of two sources:\n1) WinReg.txt, by B.H., which may be accessed at:\n   http://pogostick.net/~pnh/ntpasswd/WinReg.txt\n2) The Windows NT Registry File Format version 0.4, by\n   Timothy D. Morgan, which may be accessed at:\n   https://docs.google.com/viewer?url=http%3A%2F%2Fsentinelchicken.com%2Fdata%2FTheWindowsNTRegistryFileFormat.pdf\nCopies of these resources are included in the\n`documentation/` directory of the python-registry source.\n\n\nThe source directory for python-registry contains a `sample/`\nsubdirectory that contains small programs that use python-registry.\nFor example, `regview.py` is a read-only clone of Microsoft Window's\nRegedit, implemented in a few hundred lines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliballenthin%2Fpython-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliballenthin%2Fpython-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliballenthin%2Fpython-registry/lists"}