MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / asdict

Method asdict

src/ifctester/ifctester/ids.py:127–142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

125 self.info["milestone"] = milestone
126
127 def asdict(self) -> dict[str, Any]:
128 info: dict[str, Any] = {}
129 for attr in ["title", "copyright", "version", "description", "author", "date", "purpose", "milestone"]:
130 if attr in self.info:
131 info[attr] = self.info[attr]
132 ids_dict: dict[str, Any] = {
133 "@xmlns": "http://standards.buildingsmart.org/IDS",
134 "@xmlns:xs": "http://www.w3.org/2001/XMLSchema",
135 "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
136 "@xsi:schemaLocation": "http://standards.buildingsmart.org/IDS http://standards.buildingsmart.org/IDS/1.0/ids.xsd",
137 "info": info,
138 "specifications": {"specification": []},
139 }
140 for spec in self.specifications:
141 ids_dict["specifications"]["specification"].append(spec.asdict())
142 return ids_dict
143
144 def parse(self, data):
145 for attribute in ["title", "copyright", "version", "description", "author", "date", "purpose", "milestone"]:

Calls 1

appendMethod · 0.45