aac.in_out.writer

AaC Module for easy file writing.

Functions

write_definitions_to_file(definitions, file_uri)

Given a list of definitions, write them to file uri.

write_file(uri, content[, overwrite])

Write string content to a file.

aac.in_out.writer.write_definitions_to_file(definitions: list[Definition], file_uri: str, is_user_editable: bool = True) None[source]

Given a list of definitions, write them to file uri. Updates the source for definitions passed in.

Parameters:
  • definitions (list[Definition]) – The definitions to write to file.

  • file_uri (str) – The URI of the file to write the definitions to.

  • is_user_editable (bool) – True if the AaC file can be edited by users.

Return type:

None

aac.in_out.writer.write_file(uri: str, content: str, overwrite: bool = False) None[source]

Write string content to a file.

Parameters:
  • uri (str) – the file’s full uri

  • content (str) – contents of the file to write

  • overwrite (bool) – True to overwrite an existing file or false to not.

Return type:

None