### Install Syside with ReqIF Extra Source: https://docs.sensmetry.com/python/latest/syside/reqif/index.html Install the syside package with the necessary 'reqif' extra dependencies for ReqIF functionality. This is required for both public functions and the CLI. ```bash pip install 'syside[reqif]' # or, for uv-managed projects: uv add 'syside[reqif]' ``` -------------------------------- ### Initializing IdMap Source: https://docs.sensmetry.com/python/latest/syside/IdMap.html Initializes an empty IdMap. No specific setup is required beyond instantiating the class. ```python map = IdMap() ``` -------------------------------- ### init Source: https://docs.sensmetry.com/python/latest/syside/reqif/index.html Initialises the current workspace for ReqIF <-> SysMLv2 conversion. This function should be called once to set up the environment. ```APIDOC ## init ### Description Initialise the current workspace for ReqIF <-> SysMLv2 conversion. ### Parameters #### Request Body - **opts** (InitOptions) - Required - Options for initialization. ### Request Example ```python from syside.reqif import init, InitOptions init(InitOptions(lib_dir=None)) ``` ### Response #### Success Response (200) No explicit response body documented, function operates via side effects. ``` -------------------------------- ### Initialize, Check, and Import ReqIF File Source: https://docs.sensmetry.com/python/latest/syside/reqif/index.html Demonstrates the basic workflow for initializing the workspace, validating a ReqIF file using `check_reqif`, and then importing it with `import_`. Ensure the workspace is initialized once before performing other operations. Attachments are saved to './attachments_reqif/'. ```python from pathlib import Path from syside.reqif import ( ImportOptions, CheckReqifOptions, InitOptions, check_reqif, import_, init, ) # Initialise the workspace once. init(InitOptions(lib_dir=None)) # Validate a ReqIF file before importing it. reqif_file = Path("requirements.reqif") check_reqif(CheckReqifOptions(file=reqif_file)) # Import the file; attachments land in ./attachments_reqif/. import_(ImportOptions(file=reqif_file, attachments_dir=None)) ``` -------------------------------- ### metaclass_for Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Get a corresponding metaclass for model type. ```APIDOC ## metaclass_for ### Description Get a corresponding metaclass for model type. ### Parameters * **_arg** (type[syside.Element]_) - Description not available * **_/ _** (any) - Description not available ### Returns * **syside.Metaclass | syside.MetadataDefinition | None** ``` -------------------------------- ### operator_function_for Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Get a corresponding standard library operator function for `operator`. ```APIDOC ## operator_function_for ### Description Get a corresponding standard library operator function for `operator`. ### Parameters * **_operator** (syside.Operator_) - Description not available ### Returns * **syside.Function | None** ``` -------------------------------- ### __init__ Source: https://docs.sensmetry.com/python/latest/syside/Compiler.html Initializes the Compiler with a maximum number of evaluation steps. ```APIDOC ## Method __init__ ### Signature __init__(_max_steps : int = 100000_) → None ### Description Initializes the Compiler instance. The `max_steps` parameter sets the limit for expression evaluation steps. ``` -------------------------------- ### Syside Configuration Example Source: https://docs.sensmetry.com/python/latest/syside/conf/Config.html A TOML configuration file for Syside, demonstrating settings for standard library path, exclusions, LSP, telemetry, and formatting. ```toml #:schema https://docs.sensmetry.com/schemas/latest/syside.schema.json std = "path/to/sysml.library" include = [] exclude = ["lib", "out", "dist"] [lsp] completion-limit = 256 edit = "all" [telemetry] crash-reports = "ignore" [format] line-width = 100 tab-width = 4 tabs = false [format.keywords.null] fallback = "null" preserve = false [lint] standard-library-package = "warning" ``` -------------------------------- ### Syside Build Date Source: https://docs.sensmetry.com/python/latest/syside/version/index.html Get the datetime object representing when Syside was built. ```APIDOC ## Functions date() -> datetime.datetime - Datetime of when Syside was built ``` -------------------------------- ### visibility_kind Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Get a corresponding standard library `KerML::Root::VisibilityKind` feature. ```APIDOC ## visibility_kind ### Description Get a corresponding standard library `KerML::Root::VisibilityKind` feature. ### Parameters * **_arg** (syside.VisibilityKind_) - Description not available * **_/ _** (any) - Description not available ### Returns * **syside.Feature | None** ``` -------------------------------- ### __init__ Source: https://docs.sensmetry.com/python/latest/syside/Sema.html Initializes the Sema class. ```APIDOC ## __init__ ### Description Initializes the Sema class. ### Method __init__ ### Parameters None ### Response None ``` -------------------------------- ### trigger_kind Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Get a corresponding standard library `SysML::Systems::TriggerKind` feature. ```APIDOC ## trigger_kind ### Description Get a corresponding standard library `SysML::Systems::TriggerKind` feature. ### Parameters * **_operator** (syside.TriggerKind_) - Description not available ### Returns * **syside.EnumerationUsage | None** ``` -------------------------------- ### _from_args Source: https://docs.sensmetry.com/python/latest/syside/reqif/ImportOptions.html Builds import options from parsed arguments, assembling the `split_by` configuration and validating split-flag combinations. ```APIDOC ## _from_args ### Description Constructs import options from parsed command-line arguments, validating split configurations. ### Method `classmethod _from_args(args: argparse.Namespace) -> Self` ``` -------------------------------- ### transition_feature_kind Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Get a corresponding standard library `SysML::Systems::TransitionFeatureKind` feature. ```APIDOC ## transition_feature_kind ### Description Get a corresponding standard library `SysML::Systems::TransitionFeatureKind` feature. ### Parameters * **_arg** (syside.TransitionFeatureKind_) - Description not available * **_/ _** (any) - Description not available ### Returns * **syside.EnumerationUsage | None** ``` -------------------------------- ### __init__(_preference) Source: https://docs.sensmetry.com/python/latest/syside/ReferencePrinter.html Constructs a reference printer that selects identifiers for printing using a given preference. This allows for customized naming conventions. ```APIDOC ## __init__(_preference_) ### Description Construct a reference printer that will select identifiers for printing using the given preference. ### Method __init__(_preference : syside.NamePreference_) ### Parameters * **_preference** (syside.NamePreference) - The preference to use for selecting identifiers. ### Response None ``` -------------------------------- ### state_subaction_kind Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Get a corresponding standard library `SysML::Systems::StateSubactionKind` feature. ```APIDOC ## state_subaction_kind ### Description Get a corresponding standard library `SysML::Systems::StateSubactionKind` feature. ### Parameters * **_arg** (syside.StateSubactionKind_) - Description not available * **_/ _** (any) - Description not available ### Returns * **syside.EnumerationUsage | None** ``` -------------------------------- ### _Environment.from_stdlib_files Source: https://docs.sensmetry.com/python/latest/syside/Environment.html Constructs an Environment instance from a list of standard library file paths. ```APIDOC ## class _Environment.from_stdlib_files ### Description Construct the environment from the given stdlib files. ### Method classmethod ### Parameters #### Path Parameters - **stdlib_files** (list[pathlib.Path]) - Required - The paths to SysMLv2 or KerML files representing the stdlib. These files must have correct file extensions (`.sysml` or `.kerml`). ### Returns syside.Environment ``` -------------------------------- ### init Source: https://docs.sensmetry.com/python/latest/syside/reqif/index.html Initializes the current workspace for ReqIF <-> SysMLv2 conversion. It scans for an existing canonical SysMLv2 ReqIF library and writes it if not found. Returns 0 on success or 3 if multiple library files are detected. ```APIDOC ## init ### Description Initialise the current workspace for ReqIF <-> SysMLv2 conversion. Scans the current working directory for an existing `<{LIBRARY_PKG}>.sysml` file (where `LIBRARY_PKG` is `syside.reqif.LIBRARY_PKG`), normalising any BOM and CRLF/CR line endings before comparison so a Windows checkout is not mistaken for a stale copy. If the canonical library content is already present nothing happens; otherwise the canonical SysMLv2 ReqIF library is written under `opts.lib_dir` (or `syside.reqif.LIBRARY_DIR` when unset). Returns `0` on success, or `3` if more than one `<{LIBRARY_PKG}>.sysml` is found in the workspace (a “first hit wins” rewrite would silently leave the other copies stale) — emitted as an `ERROR` log line rather than a traceback. ### Function Signature `init(_opts : syside.reqif.InitOptions_) → int` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (0) Returns `0` on success. #### Error Response (3) Returns `3` if more than one library file is found. ``` -------------------------------- ### requirement_constraint_kind Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Get a corresponding standard library `SysML::Systems::RequirementConstraintKind` feature. ```APIDOC ## requirement_constraint_kind ### Description Get a corresponding standard library `SysML::Systems::RequirementConstraintKind` feature. ### Parameters * **_arg** (syside.RequirementConstraintKind_) - Description not available * **_/ _** (any) - Description not available ### Returns * **syside.EnumerationUsage | None** ``` -------------------------------- ### main Source: https://docs.sensmetry.com/python/latest/syside/cli/index.html Entry point to the internal Syside CLI. It accepts arguments and can optionally take an interactive handler or external commands. It returns an exit code upon completion and handles Unicode stream configurations. ```APIDOC ## main ### Description Entry point to internal Syside CLI. Returns exit code on completion. `args` must either be ` args...` or ` -m args...`, i.e. they must be the same as called from the command line, e.g. `sys.argv`. The `interactive` argument is used to provide Python implementation for the `interactive` command. Raises anything `interactive` or `external` may raise if executed. The `server` command will use underlying native `stdin` and `stdout` streams directly, any modifications to `sys.stdout` and `sys.stdin` will not be propagated. **Warning**: Multiple threads running `server` command simultaneously are not supported as it overrides global exit and error hooks. If multiple servers are needed, run them in separate processes. **Note**: Syside depends on output streams supporting full Unicode range. If the standard stream encoding is not Unicode, e.g. `not encoding.startswith("utf")`, it will be temporarily `reconfigured` to platform-specific encoding. ### Parameters * **_args** (Sequence[str]) - Description: Arguments passed to the CLI. * **_interactive** (Callable[[syside.cli.Interactive], int] | None) - Optional - Description: Python implementation for the `interactive` command. * **_external** (Sequence[syside.cli.ExternalCommand]) - Optional - Description: Sequence of external commands to be executed. ### Returns * **int** - Exit code on completion. ``` -------------------------------- ### portion_kind Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Get a corresponding standard library `SysML::Systems::PortionKind` feature. ```APIDOC ## portion_kind ### Description Get a corresponding standard library `SysML::Systems::PortionKind` feature. ### Parameters * **_arg** (syside.PortionKind_) - Description not available * **_/ _** (any) - Description not available ### Returns * **syside.EnumerationUsage | None** ``` -------------------------------- ### feature_direction_kind Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Get a corresponding standard library `KerML::Core::FeatureDirectionKind` feature. ```APIDOC ## feature_direction_kind ### Description Get a corresponding standard library `KerML::Core::FeatureDirectionKind` feature. ### Parameters * **_arg** (syside.FeatureDirectionKind_) - Description not available * **_/ _** (any) - Description not available ### Returns * **syside.Feature | None** ``` -------------------------------- ### __init__(_callback) Source: https://docs.sensmetry.com/python/latest/syside/ReferencePrinter.html Constructs a reference printer with a custom path callback. This provides advanced customization for how references are printed, allowing for dynamic path generation based on target and referent elements. ```APIDOC ## __init__(_callback_) ### Description Construct a reference printer with a custom path callback. The signature is `(target: Element, referent: Element) -> Sequence[str] | NamePreference`, where: * `target` is the element that is referenced. Callback should return the path to it. * `referent` is the referent element, e.g. `Membership`. Callback may also choose to return a name preference which will be used to print the reference instead. ### Method __init__(_callback : Callable[[syside.Element, syside.Element], Sequence[str] | syside.NamePreference]_) ### Parameters * **_callback** (Callable[[syside.Element, syside.Element], Sequence[str] | syside.NamePreference]) - A callback function that generates the path or name preference for a reference. ### Response None ``` -------------------------------- ### SemanticTokenModifiersSet Get Item Source: https://docs.sensmetry.com/python/latest/syside/ide/SemanticTokenModifiersSet.html Checks if a specific SemanticTokenModifier or integer index is present in the set. ```APIDOC ## __getitem__ ### Description Checks if a specific SemanticTokenModifier or integer index is present in the set. ### Method __getitem__(arg: syside.ide.lsp.SemanticTokenModifiers_ | int) -> bool ### Parameters * `arg` (syside.ide.lsp.SemanticTokenModifiers_ | int) - The SemanticTokenModifier or integer index to check. ### Returns bool - True if the item is in the set, False otherwise. ``` -------------------------------- ### __init__() Source: https://docs.sensmetry.com/python/latest/syside/ReferencePrinter.html Constructs a default reference printer. This is a simple constructor for basic reference printing needs. ```APIDOC ## __init__() ### Description Constructs a default reference printer. ### Method __init__() ### Parameters None ### Response None ``` -------------------------------- ### Get Owning Document Source: https://docs.sensmetry.com/python/latest/syside/OccurrenceDefinition.html The `document` attribute returns the `document` that owns the current node. ```python node.document ``` -------------------------------- ### __init__ Source: https://docs.sensmetry.com/python/latest/syside/PipelineOptions.html Constructor for pipeline options. It initializes the static_index and lib attributes, which are optional. If not provided, empty containers are created. These attributes are updated on each pipeline run. ```APIDOC ## __init__ ### Description Constructor for pipeline options. `static_index` and `lib` are optional, and empty containers will be constructed if not provided. On each run, the pipeline will update the bound `static_index` and `lib` on every execution. ### Method __init__ ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **static_index** (syside.StaticIndex | None) - Optional - Index used to resolve globally accessible names. * **lib** (syside.Stdlib | None) - Optional - Standard library cache used to resolve elements for semantic constraints. ### Response #### Success Response None #### Response Example None ### Used In * `syside` * `make_pipeline` ``` -------------------------------- ### Constructor Expression Syntax Source: https://docs.sensmetry.com/python/latest/history.html Illustrates the syntax for constructor expressions, which invoke non-Step, non-Behavior types. Requires the 'new' keyword prefix. ```text attribute x = Type(2); ``` ```text attribute x = new Type(2); ``` -------------------------------- ### Get Parent Node Source: https://docs.sensmetry.com/python/latest/syside/Metaclass.html The `parent` attribute returns the parent node of the current node. ```python obj.parent ``` -------------------------------- ### Get Document Owner Source: https://docs.sensmetry.com/python/latest/syside/Metaclass.html The `document` attribute returns the `document` that owns the current node. ```python obj.document ``` -------------------------------- ### FromKeyword Configuration Options Source: https://docs.sensmetry.com/python/latest/syside/conf/FromKeyword.html Provides options to configure the formatting of the 'from' keyword for different elements like binary connectors, dependencies, flows, and their usages. ```APIDOC ## Class FromKeyword Options for `from` keyword formatting. ### Members - `connector` (RW): When `from` keyword is printed in binary connectors (KerML). - `dependency` (RW): When `from` keyword is printed in dependencies. - `flow` (RW): When `from` keyword is printed in flows (KerML). - `flow_usage` (RW): When `from` keyword is printed in flow usages. - `succession_flow` (RW): When `from` keyword is printed in succession flows (KerML). - `succession_flow_usage` (RW): When `from` keyword is printed in succession flow usages. ### Methods - `__init__()`: Initializes the FromKeyword configuration. ``` -------------------------------- ### __init__ Source: https://docs.sensmetry.com/python/latest/syside/Stdlib.html Initialize cache from a given index. Cache will try to find elements only in the given index. ```APIDOC ## __init__ ### Description Initialize cache from a given index. Cache will try to find elements only in the given index. ### Parameters * **_arg** (syside.StaticIndex_) - Description not available * **_/ _** (any) - Description not available ### Returns * **None** ``` -------------------------------- ### RangeUtf8 Class Source: https://docs.sensmetry.com/python/latest/syside/RangeUtf8.html Represents a UTF-8 based text range with start and end positions. ```APIDOC ## Class RangeUtf8 ### Description Represents a UTF-8 based text range. ### Members - `start` (syside.PositionUtf8): The starting position of the range. - `end` (syside.PositionUtf8): The ending position of the range. ### Methods #### __init__ ```python __init__(_start : syside.PositionUtf8_, _end : syside.PositionUtf8_) -> None ``` Initializes a new RangeUtf8 object with the specified start and end positions. #### __str__ ```python __str__() -> str ``` Returns a string representation of the RangeUtf8 object. ``` -------------------------------- ### Create a Syside Pipeline Source: https://docs.sensmetry.com/python/latest/low-level.html Constructs a new pipeline with specified options. The 'lib' and 'static_index' options can be set to None. ```python pipeline: syside.Pipeline = syside.make_pipeline( syside.PipelineOptions(lib=None, static_index=None) ) ``` -------------------------------- ### RangeUtf32 Class Source: https://docs.sensmetry.com/python/latest/syside/RangeUtf32.html Represents a UTF-32 based text range with start and end positions. ```APIDOC ## Class RangeUtf32 ### Description Represents a UTF-32 based text range. ### Attributes - `end` (syside.PositionUtf32_): End position of this range. - `start` (syside.PositionUtf32_): Start position of this range. ### Methods #### __init__ ```python __init__(_start : syside.PositionUtf32_, _end : syside.PositionUtf32_) -> None ``` Initializes a new RangeUtf32 object with the specified start and end positions. #### __str__ ```python __str__() -> str ``` Returns a string representation of the RangeUtf32 object. ``` -------------------------------- ### __init__ Source: https://docs.sensmetry.com/python/latest/syside/experimental/viz/TransformationContext.html Initializes the TransformationContext. This is a constructor method and is not directly callable as an API endpoint but is part of the class's interface. ```APIDOC ## __init__ ### Description Initializes the TransformationContext object. This method is part of the class constructor. ### Method Constructor ### Parameters This method does not take any explicit parameters. ### Response Initializes a new instance of the TransformationContext class. ### Response Example ```python context = TransformationContext() ``` ``` -------------------------------- ### RangeUtf16 Class Source: https://docs.sensmetry.com/python/latest/syside/RangeUtf16.html Represents a UTF-16 based text range with start and end positions. ```APIDOC ## Class: RangeUtf16 ### Description Represents a UTF-16 based text range. ### Members - `start`: Start position of this range (RW). - `end`: End position of this range (RW). ### Methods #### `__init__(_start: syside.PositionUtf16_, _end: syside.PositionUtf16_) -> None` Initializes a new RangeUtf16 object. #### `__str__() -> str` Returns a string representation of the range. ``` -------------------------------- ### Get Top Elements From Path Source: https://docs.sensmetry.com/python/latest/syside/preview/LockedModel.html Retrieves top-level elements loaded from a specified file or directory path. ```APIDOC ## top_elements_from ### Description Yields top level owned member elements (typically Packages) loaded from the specified path(or from files below that path if it is a directory). Note that imported members are not taken into account. ### Method top_elements_from(_path : str | pathlib.Path_) → Iterator[syside.Element] ### Parameters #### Path Parameters - **path** (str | pathlib.Path) - Source file or directory path to return elements loaded from. ### Returns Sequence of (top) model elements loaded from source file(s) matching `path`. ### Raises **RuntimeError** – if used after unlocking ``` -------------------------------- ### EncodingOpts Constructor Source: https://docs.sensmetry.com/python/latest/syside/EncodingOpts.html Initializes EncodingOpts with customizable percent-encoding behaviors. ```APIDOC ## EncodingOpts Constructor ### Description Initializes the EncodingOpts object with specified options for percent-encoding. ### Method __init__ ### Parameters - **space_as_plus** (bool) - Optional - True if spaces should be encoded to and from plus signs. - **lower_case** (bool) - Optional - True if hexadecimal digits should be emitted as lower case. - **disallow_null** (bool) - Optional - True if null values are not allowed during decoding. ### Usage ```python options = EncodingOpts(space_as_plus=True, lower_case=False, disallow_null=False) ``` ``` -------------------------------- ### Get Top Elements Source: https://docs.sensmetry.com/python/latest/syside/preview/LockedModel.html Retrieves all top-level named elements owned by the model's root namespace. ```APIDOC ## top_elements ### Description Yields all top level named elements (typically Packages) that are owned members of a root namespace in the model. Note that imported members are not taken into account. ### Method top_elements() → Iterator[syside.Element] ### Returns Sequence of top level elements. ### Raises **RuntimeError** – if used after unlocking ``` -------------------------------- ### Get Element Qualified Name Source: https://docs.sensmetry.com/python/latest/syside/OccurrenceDefinition.html The `qualified_name` attribute provides the SysML implementation of the qualified name for an element. ```python ocd.qualified_name ``` -------------------------------- ### TypeFeaturing.Std Type Hinting Example Source: https://docs.sensmetry.com/python/latest/syside/TypeFeaturing.html Shows how to use TypeFeaturing.Std for type hinting in function signatures. This ensures correct type resolution for annotations. ```python def function(element: Element) -> TypeFeaturing.Std: ... ``` -------------------------------- ### InitOptions Class Source: https://docs.sensmetry.com/python/latest/syside/reqif/InitOptions.html The InitOptions class stores parsed arguments for the `syside reqif init` subcommand, including the destination directory for the SysMLv2 ReqIF library. ```APIDOC ## Class InitOptions Parsed arguments for the `syside reqif init` subcommand. ### Attributes * **lib_dir** (`pathlib.Path` or `None`): Destination directory for the SysMLv2 ReqIF library. When `None`, defaults to `syside.reqif.LIBRARY_DIR` (`--lib-dir`). ### Methods * **static add_args**(_parser : argparse.ArgumentParser_) -> None: Register this subcommand’s flags onto `parser`. Used in: * `syside.reqif` * `init` ```