MODULE

MKAPI.UTILS

Functions
  • get_object(name) (any) Reutrns an object specified by name.</>
function

mkapi.utils.get_object(name) → any

Reutrns an object specified by name.

Parameters
  • name (str) Object name.
Examples
>>> import inspect
>>> obj = get_object('mkapi.core')
>>> inspect.ismodule(obj)
True
>>> obj = get_object('mkapi.core.base')
>>> inspect.ismodule(obj)
True
>>> obj = get_object('mkapi.core.node.Node')
>>> inspect.isclass(obj)
True
>>> obj = get_object('mkapi.core.node.Node.get_markdown')
>>> inspect.isfunction(obj)
True
function

mkapi.utils.split_filters(name)

Parameters
  • name
Examples
>>> split_filters("a.b.c")
('a.b.c', [])
>>> split_filters("a.b.c|upper|strict")
('a.b.c', ['upper', 'strict'])
>>> split_filters("|upper|strict")
('', ['upper', 'strict'])
>>> split_filters("")
('', [])
function

mkapi.utils.update_filters(org, update) → list of str

Parameters
  • org (list of str)
  • update (list of str)
Examples
>>> update_filters(['upper'], ['lower'])
['lower']
>>> update_filters(['lower'], ['upper'])
['upper']
>>> update_filters(['long'], ['short'])
['short']
>>> update_filters(['short'], ['long'])
['long']