Welcome to sysml2py’s documentation!
Created on Mon May 29 23:26:16 2023
@author: christophercox
- sysml2py.load(fp)
SysML load from file pointer
Deserialize
fp
(a.read()
-supporting file-like object containing a SysML v2.0 document) to a Python dictionary object.- Parameters:
fp (_io.TextIOWrapper) – File pointer to SysML v2.0 document
- Returns:
Dictionary version structured utilizing SysML v2.0 grammar with some modifications to support available python libraries.
- Return type:
dict
- Raises:
TypeError – Input was not _io.TextIOWrapper
- sysml2py.load_grammar(fp, debug=False, enforce=False)
SysML load from file pointer
Deserialize
fp
(a.read()
-supporting file-like object containing a SysML v2.0 document) ors
(astr
instance containing a SysML v2.0 document) to a Python dictionary object.- Parameters:
fp (_io.TextIOWrapper or str) – File pointer to SysML v2.0 document or string instance of SysML v2.0 document
- Returns:
Dictionary version structured utilizing SysML v2.0 grammar with some modifications to support available python libraries.
- Return type:
dict
- Raises:
TypeError – Input was not _io.TextIOWrapper
- sysml2py.loads(s: str)
Loads a model from string.
This shortcut function allows a user to build a model from a string by first instantiating a base model class which builds out a default namespace and then that model loads all elements underneath.