unitelabs.jsondocs.utils

Attributes

  • Name
    GriffeObjType
    Type
    Value

    = typing.Union[griffe.Object, griffe.Class, griffe.Function, griffe.Module, griffe.Attribute]

    Description

Functions

  • get_name(obj : GriffeObjType) -> str

    Extract `obj`s name. For an obj `B` deriving from obj `A`, the name for any method or attribute of `A` which is not overridden by `B` will be the qualified path of the method in `A`. In this case, the `obj.canonical_path` will not equal the `obj.path`. We intentionally return the `obj.canonical_path` here, as it reduces redundancy.

    Parameters

    Response

    Type
    str
    Description

  • get_mro(obj : GriffeObjType) -> list[str]

    For a given `GriffeObjType` object return the MRO of the object.

    Parameters

    Response

    Type
    list[str]
    Description

  • mro_sort(a : GriffeObjType, b : GriffeObjType, mro : list[str]) -> None

    For two `GriffeObjType` objects sort them first by their MRO and, if equal, by their line number.

    Parameters

  • sort_values_list_by_mro(obj : GriffeObjType, values_list : list[GriffeObjType]) -> list[str]

    For a given `obj` sort the values in `values_list` by `obj`s MRO.

    Parameters

    Response

    Type
    list[str]
    Description

  • get_semver(version_str : str) -> str

    For a distribution or build version string build the semver version string.

    Parameters

    • Name
      version_str
      Type
      str
      Default
      Description

    Response

    Type
    str
    Description

Copyright © 2024