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

Function open

src/ifctester/ifctester/ids.py:56–65  ·  view source on GitHub ↗
(filepath: str, validate: bool = False)

Source from the content-addressed store, hash-verified

54
55
56def open(filepath: str, validate: bool = False) -> Ids:
57 try:
58 if validate:
59 get_schema().validate(filepath)
60 decode = get_schema().decode(
61 filepath, strip_namespaces=True, namespaces={"": "http://standards.buildingsmart.org/IDS"}
62 )
63 except XMLSchemaValidationError as e:
64 raise IdsXmlValidationError(e, f"Provided .ids file ({filepath}) appears to be invalid. See details above.")
65 return Ids().parse(decode)
66
67
68def from_string(xml: str, validate: bool = False) -> Ids:

Callers 15

to_fileMethod · 0.70
to_fileMethod · 0.70
to_stringMethod · 0.70
to_fileMethod · 0.70
build-all.pyFile · 0.50
runFunction · 0.50
build_dependencyFunction · 0.50
tests.pyFile · 0.50
get_file_sha256_hashFunction · 0.50
choco_release.pyFile · 0.50
generateMethod · 0.50

Calls 6

get_schemaFunction · 0.85
IdsClass · 0.85
validateMethod · 0.45
decodeMethod · 0.45
parseMethod · 0.45