aac.plugins.generate.helpers.python_helpers

Python helpers for the generate plugin that can be passed into Jinja2 and used in templates.

Functions

aac_version()

Returns the current version of AaC.

get_package_from_aac_definition(item_name)

Returns the package for an AaC definition.

get_package_from_plugin(plugin_name)

Returns the package for an AaC plugin.

get_path_from_package(package)

Converts a package to a path.

get_python_name(name)

Returns the python name for an AaC name.

get_python_primitive(aac_primitive_name)

Returns the python primitive for an AaC primitive.

get_python_type(aac_type_name)

Returns the python type for an AaC type.

schema_to_test_dict(name[, omit_optional_fields])

Generate test data for a schema to a dictionary based on its fields.

aac.plugins.generate.helpers.python_helpers.aac_version() str[source]

Returns the current version of AaC.

Return type:

str

aac.plugins.generate.helpers.python_helpers.get_package_from_aac_definition(item_name: str) str[source]

Returns the package for an AaC definition.

Parameters:

item_name (str)

Return type:

str

aac.plugins.generate.helpers.python_helpers.get_package_from_plugin(plugin_name: str) str[source]

Returns the package for an AaC plugin.

Parameters:

plugin_name (str)

Return type:

str

aac.plugins.generate.helpers.python_helpers.get_path_from_package(package: str) str[source]

Converts a package to a path.

Parameters:

package (str)

Return type:

str

aac.plugins.generate.helpers.python_helpers.get_python_name(name: str) str[source]

Returns the python name for an AaC name.

Parameters:

name (str)

Return type:

str

aac.plugins.generate.helpers.python_helpers.get_python_primitive(aac_primitive_name: str) str[source]

Returns the python primitive for an AaC primitive.

Parameters:

aac_primitive_name (str)

Return type:

str

aac.plugins.generate.helpers.python_helpers.get_python_type(aac_type_name: str) str[source]

Returns the python type for an AaC type.

Parameters:

aac_type_name (str)

Return type:

str

aac.plugins.generate.helpers.python_helpers.schema_to_test_dict(name: str, omit_optional_fields: bool = False) dict[source]

Generate test data for a schema to a dictionary based on its fields.

Parameters:
  • name (str)

  • omit_optional_fields (bool)

Return type:

dict