Skip to content
Back to top
View this page

# `autodoc2.db`

## Module Contents

### Classes

`Database` |
`InMemoryDb` |

### Data

`_LIKE_REGEX` |

### API

exception autodoc2.db.UniqueError

  Bases: `KeyError`

  Initialization

class autodoc2.db.Database

  Bases: `typing.Protocol`

  add(item: autodoc2.utils.ItemData) → None
  remove(full_name: str, descendants: bool) → None
  __contains__(full_name: str) → bool
  get_item(full_name: str) → autodoc2.utils.ItemData | None
  get_items_like(full_name: str) → Iterable[autodoc2.utils.ItemData]
  get_type(full_name: str) → None | str
  get_by_type(type_: str) → Iterable[autodoc2.utils.ItemData]
  get_overloads(full_name: str) → Iterable[autodoc2.utils.ItemData]
  get_children(full_name: str, types: None | set[str] = None, *, sort_name: bool = False) → Iterable[autodoc2.utils.ItemData]
  get_children_names(full_name: str, types: None | set[str] = None, *, sort_name: bool = False) → Iterable[str]
  get_ancestors(full_name: str, include_self: bool) → Iterable[autodoc2.utils.ItemData | None]

autodoc2.db._LIKE_REGEX

  None

class autodoc2.db.InMemoryDb

  Bases: `autodoc2.db.Database`

  Initialization

  add(item: autodoc2.utils.ItemData) → None
  remove(full_name: str, descendants: bool) → None
  __contains__(full_name: str) → bool
  get_item(full_name: str) → autodoc2.utils.ItemData | None
  get_items_like(full_name: str) → Iterable[autodoc2.utils.ItemData]
  get_type(full_name: str) → None | str
  get_by_type(type_: str) → Iterable[autodoc2.utils.ItemData]
  get_overloads(full_name: str) → Iterable[autodoc2.utils.ItemData]
  get_children(full_name: str, types: None | set[str] = None, *, sort_name: bool = False) → Iterable[autodoc2.utils.ItemData]
  get_children_names(full_name: str, types: None | set[str] = None, *, sort_name: bool = False) → Iterable[str]
  get_ancestors(full_name: str, include_self: bool) → Iterable[autodoc2.utils.ItemData | None]
  write(stream: TextIO) → None
  classmethod read(stream: TextIO) → autodoc2.db.InMemoryDb