module apibook.data

Classes

class Arg:

Information about a function argument.

Fields

  • name: str

  • type: str

  • default: str | None = None

  • docstring: str = None

class Signature:

Class to hold signature information for a function or method. Might also be used to hold information about a class constructor, even if those are defined on the class itself.

Fields

  • args: list

  • returns: list

  • docstring: str

class Decorator:

Class to hold decorator information for a class or function.

Fields

  • name: str

  • args: list

  • kwargs: dict

  • is_call: bool = False

  • is_property: bool = False

class Class:

Class to hold class information.

Fields

  • name: str

  • bases: list

  • decorators: list

  • methods: list

  • fields: list

  • docstring: str

Methods

def to_md(self) -> None

Convert class to markdown.

class Method:

Class to hold method information.

Fields

  • name: str

  • args: list

  • kwonlyargs: list

  • returns: str

  • docstring: str

Methods

def to_md(self, is_method, extra_signature) -> None

Convert method to markdown.

Arguments:

  • is_method
  • extra_signature(Signature)

class Module:

Class to hold module information.

Fields

  • name: str

  • docstring: str

  • classes: list

  • functions: list

  • variables: list

  • aliases: list

  • all_exports: list

  • imports: list

Methods

def resolve_export(self, item) -> str

Resolve an export to a module + item.

Arguments:

  • item
def resolve_import(self, item) -> (str, str)

Resolve an import to a module + item.

Arguments:

  • item(str): the item to resolve

Returns:

  • the module containing the item the item queried
def to_md(self) -> None

Convert module to markdown.

class NakedImport:

Fields

  • module: str

Methods

def to_md(self) -> None

class FromImport:

Fields

  • module: str

  • names: list

  • relative: int

Methods

def to_md(self) -> None

class TypeAlias:

Fields

  • name: str

  • type: str

Methods

def to_md(self) -> None

class ClassField:

Fields

  • name: str

  • type: str

  • default: str | None

class Variable:

Fields

  • name: str

  • value: str