Skip to content

Strings#

Mypy_boto3_builder Index / Mypy Boto3 Builder / Utils / Strings

Auto-generated documentation for mypy_boto3_builder.utils.strings module.

capitalize#

Show source in strings.py:165

Capitalize first letter of a string.

Signature#

def capitalize(s: str) -> str: ...

clean_artifacts#

Show source in strings.py:87

Remove common artifacts in botocre docs.

Signature#

def clean_artifacts(line: str) -> str: ...

Show source in strings.py:37

Convert header to markdown anchor link.

Signature#

def get_anchor_link(text: str) -> str: ...

get_botocore_class_name#

Show source in strings.py:137

Get Botocore class name from Service metadata.

Signature#

def get_botocore_class_name(metadata: dict[str, str]) -> str: ...

get_class_prefix#

Show source in strings.py:23

Get a valid Python class prefix from func_name.

Arguments#

  • func_name - Any string.

Returns#

String with a class prefix.

Signature#

def get_class_prefix(func_name: str) -> str: ...

get_short_docstring#

Show source in strings.py:51

Create a short docstring from boto3 documentation.

Trims docstring to 300 chars. Removes double and triple backticks. Stops on **Request syntax** and ::. Ensures that backticks are closed. Replaces Text <link> with Text. Wraps docstring to 80 chars.

Signature#

def get_short_docstring(doc: str) -> str: ...

get_type_def_name#

Show source in strings.py:148

Get a valid Python TypeDef class name from parts.

Examples#

get_type_def_name("MyClass", "my_method")  # MyClassMyMethodTypeDef

Signature#

def get_type_def_name(*parts: str) -> str: ...

is_reserved#

Show source in strings.py:44

Check whether varialbe name conflicts with Python reserved names.

Signature#

def is_reserved(word: str) -> bool: ...

textwrap#

Show source in strings.py:110

Wrap text to width chars.

Signature#

def textwrap(text: str, width: int) -> str: ...