utils¶

boto3_dataclass.utils.compare_code(code: str, expected: str, dedent: bool = True, debug: bool = False) bool[source]¶

Compares whether two pieces of code are identical, ignoring whitespace and indentation.

Parameters:
  • code – The generated code string.

  • expected – The expected code string.

Returns:

Returns True if the two code strings are identical after ignoring whitespace and indentation; otherwise, returns False.

boto3_dataclass.utils.write(path: Path, content: str)[source]¶

Write content to a file, creating parent directories if they do not exist.

class boto3_dataclass.utils.SemVer(major: int, minor: int, patch: int, dev_id: str | None = None)[source]¶

Semantic Versioning (SemVer) representation.