ImportRecord
Auto-generated documentation for mypy_boto3_builder.import_helpers.import_record module.
Helper for Python import strings.
- mypy-boto3-builder / Modules / Mypy Boto3 Builder / Import Helpers / ImportRecord
ImportRecord
class ImportRecord():
def __init__(
source: ImportString,
name: str = '',
alias: str = '',
min_version: tuple[int, ...] = (3, 8),
fallback: _R | None = None,
) -> None:
Helper for Python import strings.
Arguments
source
- Source of import.name
- Import name.alias
- Import local name.min_version
- Minimum Python version, used for fallback.fallback
- Fallback ImportRecord.
See also
ImportRecord.empty
@classmethod
def empty() -> _R:
Whether import record is an empty string.
ImportRecord().get_external
def get_external(module_name: str) -> 'ImportRecord':
Get itself.
Overriden by InternalImportRecord
.
ImportRecord().get_local_name
def get_local_name() -> str:
Get local import name.
ImportRecord().is_builtins
def is_builtins() -> bool:
Whether import is from Python builtins
module.
ImportRecord().is_local
def is_local() -> bool:
Whether import is from local module.
ImportRecord().is_standalone
def is_standalone() -> bool:
Whether import record should not be grouped.
ImportRecord().is_third_party
def is_third_party() -> bool:
Whether import is from 3rd party module.
ImportRecord().is_type_defs
def is_type_defs() -> bool:
Whether import is from type_defs
module.
ImportRecord().render
def render() -> str:
Get rendered string.