diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index bfe87ef..369bebf 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -1,14 +1,14 @@
 #!/usr/bin/env python3
+import argparse
 import json
 import os
 
 import requests
-import argparse
 
-PRAGMA_ONCE = '''#pragma once
-'''
+PRAGMA_ONCE = """#pragma once
+"""
 
-WARNING = '''/****************************************************************
+WARNING = """/****************************************************************
  *                 READ THIS WARNING FIRST
  * This is an auto-generated header which contains definitions
  * for Redfish DMTF defined messages.
@@ -17,9 +17,12 @@
  * this file are owned by DMTF.  Any modifications to these files
  * should be first pushed to the relevant registry in the DMTF
  * github organization.
- ***************************************************************/'''
+ ***************************************************************/"""
 
-REGISTRY_HEADER = PRAGMA_ONCE + WARNING + '''
+REGISTRY_HEADER = (
+    PRAGMA_ONCE
+    + WARNING
+    + """
 #include "registries.hpp"
 
 #include <array>
@@ -28,25 +31,20 @@
 
 namespace redfish::registries::{}
 {{
-'''
+"""
+)
 
 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
 
 include_path = os.path.realpath(
-    os.path.join(
-        SCRIPT_DIR,
-        "..",
-        "redfish-core",
-        "include",
-        "registries"))
+    os.path.join(SCRIPT_DIR, "..", "redfish-core", "include", "registries")
+)
 
-proxies = {
-    'https': os.environ.get("https_proxy", None)
-}
+proxies = {"https": os.environ.get("https_proxy", None)}
 
 
 def make_getter(dmtf_name, header_name, type_name):
-    url = 'https://redfish.dmtf.org/registries/{}'.format(dmtf_name)
+    url = "https://redfish.dmtf.org/registries/{}".format(dmtf_name)
     dmtf = requests.get(url, proxies=proxies)
     dmtf.raise_for_status()
     json_file = json.loads(dmtf.text)
@@ -62,72 +60,68 @@
         except BaseException:
             print("{} not found".format(file))
 
-        with open(file, 'w') as registry:
+        with open(file, "w") as registry:
             registry.write(REGISTRY_HEADER.format(namespace))
             # Parse the Registry header info
             registry.write(
                 "const Header header = {{\n"
-                "    \"{json_dict[@Redfish.Copyright]}\",\n"
-                "    \"{json_dict[@odata.type]}\",\n"
-                "    \"{json_dict[Id]}\",\n"
-                "    \"{json_dict[Name]}\",\n"
-                "    \"{json_dict[Language]}\",\n"
-                "    \"{json_dict[Description]}\",\n"
-                "    \"{json_dict[RegistryPrefix]}\",\n"
-                "    \"{json_dict[RegistryVersion]}\",\n"
-                "    \"{json_dict[OwningEntity]}\",\n"
+                '    "{json_dict[@Redfish.Copyright]}",\n'
+                '    "{json_dict[@odata.type]}",\n'
+                '    "{json_dict[Id]}",\n'
+                '    "{json_dict[Name]}",\n'
+                '    "{json_dict[Language]}",\n'
+                '    "{json_dict[Description]}",\n'
+                '    "{json_dict[RegistryPrefix]}",\n'
+                '    "{json_dict[RegistryVersion]}",\n'
+                '    "{json_dict[OwningEntity]}",\n'
                 "}};\n"
                 "constexpr const char* url =\n"
-                "    \"{url}\";\n"
+                '    "{url}";\n'
                 "\n"
                 "constexpr std::array registry =\n"
                 "{{\n".format(
                     json_dict=json_dict,
                     url=url,
-                ))
+                )
+            )
 
             messages_sorted = sorted(json_dict["Messages"].items())
             for messageId, message in messages_sorted:
                 registry.write(
                     "    MessageEntry{{\n"
-                    "        \"{messageId}\",\n"
+                    '        "{messageId}",\n'
                     "        {{\n"
-                    "            \"{message[Description]}\",\n"
-                    "            \"{message[Message]}\",\n"
-                    "            \"{message[MessageSeverity]}\",\n"
+                    '            "{message[Description]}",\n'
+                    '            "{message[Message]}",\n'
+                    '            "{message[MessageSeverity]}",\n'
                     "            {message[NumberOfArgs]},\n"
                     "            {{".format(
-                        messageId=messageId,
-                        message=message
-                    ))
+                        messageId=messageId, message=message
+                    )
+                )
                 paramTypes = message.get("ParamTypes")
                 if paramTypes:
                     for paramType in paramTypes:
                         registry.write(
-                            "\n"
-                            "                \"{}\",".format(paramType)
+                            '\n                "{}",'.format(paramType)
                         )
                     registry.write("\n            },\n")
                 else:
                     registry.write("},\n")
                 registry.write(
-                    "            \"{message[Resolution]}\",\n"
-                    "        }}}},\n".format(message=message))
+                    '            "{message[Resolution]}",\n'
+                    "        }}}},\n".format(message=message)
+                )
 
-            registry.write(
-                "\n};\n"
-                "\n"
-                "enum class Index\n"
-                "{\n"
-            )
+            registry.write("\n};\n\nenum class Index\n{\n")
             for index, (messageId, message) in enumerate(messages_sorted):
                 messageId = messageId[0].lower() + messageId[1:]
-                registry.write(
-                    "    {} = {},\n".format(messageId, index))
+                registry.write("    {} = {},\n".format(messageId, index))
             registry.write(
-                "}};\n"
-                "}} // namespace redfish::registries::{}\n"
-                .format(namespace))
+                "}};\n}} // namespace redfish::registries::{}\n".format(
+                    namespace
+                )
+            )
 
 
 def get_privilege_string_from_list(privilege_list):
@@ -138,9 +132,9 @@
         for privilege in privileges:
             if privilege == "NoAuth":
                 continue
-            privilege_string += "\""
+            privilege_string += '"'
             privilege_string += privilege
-            privilege_string += "\",\n"
+            privilege_string += '",\n'
         if privilege != "NoAuth":
             privilege_string = privilege_string[:-2]
         privilege_string += "}"
@@ -158,7 +152,10 @@
     return "Or".join(names)
 
 
-PRIVILEGE_HEADER = PRAGMA_ONCE + WARNING + '''
+PRIVILEGE_HEADER = (
+    PRAGMA_ONCE
+    + WARNING
+    + """
 #include "privileges.hpp"
 
 #include <array>
@@ -167,29 +164,34 @@
 
 namespace redfish::privileges
 {
-'''
+"""
+)
 
 
 def make_privilege_registry():
-    path, json_file, type_name, url = \
-        make_getter('Redfish_1.3.0_PrivilegeRegistry.json',
-                    'privilege_registry.hpp', 'privilege')
-    with open(path, 'w') as registry:
+    path, json_file, type_name, url = make_getter(
+        "Redfish_1.3.0_PrivilegeRegistry.json",
+        "privilege_registry.hpp",
+        "privilege",
+    )
+    with open(path, "w") as registry:
         registry.write(PRIVILEGE_HEADER)
 
         privilege_dict = {}
         for mapping in json_file["Mappings"]:
             # first pass, identify all the unique privilege sets
             for operation, privilege_list in mapping["OperationMap"].items():
-                privilege_dict[get_privilege_string_from_list(
-                    privilege_list)] = (privilege_list, )
+                privilege_dict[
+                    get_privilege_string_from_list(privilege_list)
+                ] = (privilege_list,)
         for index, key in enumerate(privilege_dict):
-            (privilege_list, ) = privilege_dict[key]
+            (privilege_list,) = privilege_dict[key]
             name = get_variable_name_for_privilege_set(privilege_list)
             registry.write(
                 "const std::array<Privileges, {length}> "
-                "privilegeSet{name} = {key};\n"
-                .format(length=len(privilege_list), name=name, key=key)
+                "privilegeSet{name} = {key};\n".format(
+                    length=len(privilege_list), name=name, key=key
+                )
             )
             privilege_dict[key] = (privilege_list, name)
 
@@ -198,26 +200,29 @@
             registry.write("// {}\n".format(entity))
             for operation, privilege_list in mapping["OperationMap"].items():
                 privilege_string = get_privilege_string_from_list(
-                    privilege_list)
+                    privilege_list
+                )
                 operation = operation.lower()
 
                 registry.write(
                     "const static auto& {}{} = privilegeSet{};\n".format(
-                        operation,
-                        entity,
-                        privilege_dict[privilege_string][1]))
+                        operation, entity, privilege_dict[privilege_string][1]
+                    )
+                )
             registry.write("\n")
         registry.write(
-            "} // namespace redfish::privileges\n"
-            "// clang-format on\n")
+            "} // namespace redfish::privileges\n// clang-format on\n"
+        )
 
 
 def main():
     parser = argparse.ArgumentParser()
     parser.add_argument(
-        '--registries', type=str,
+        "--registries",
+        type=str,
         default="base,task_event,resource_event,privilege",
-        help="Comma delimited list of registries to update")
+        help="Comma delimited list of registries to update",
+    )
 
     args = parser.parse_args()
 
@@ -225,17 +230,27 @@
     files = []
 
     if "base" in registries:
-        files.append(make_getter('Base.1.13.0.json',
-                                 'base_message_registry.hpp',
-                                 'base'))
+        files.append(
+            make_getter(
+                "Base.1.13.0.json", "base_message_registry.hpp", "base"
+            )
+        )
     if "task_event" in registries:
-        files.append(make_getter('TaskEvent.1.0.3.json',
-                                 'task_event_message_registry.hpp',
-                                 'task_event'))
+        files.append(
+            make_getter(
+                "TaskEvent.1.0.3.json",
+                "task_event_message_registry.hpp",
+                "task_event",
+            )
+        )
     if "resource_event" in registries:
-        files.append(make_getter('ResourceEvent.1.0.3.json',
-                                 'resource_event_message_registry.hpp',
-                                 'resource_event'))
+        files.append(
+            make_getter(
+                "ResourceEvent.1.0.3.json",
+                "resource_event_message_registry.hpp",
+                "resource_event",
+            )
+        )
 
     update_registries(files)
 
