Skip to content

jetblack_markdown.metadata

module jetblack_markdown.metadata

Summary

Meta data

class ArgumentDescriptor(Descriptor)

Summary

A descriptor for arguments

jetblack_markdown.metadata.arguments.ArgumentDescriptor(
name: str,
type_: Optional[str],
description: Optional[str],
default: Optional[str]
) -> None

Parameters

name: str

The argument name

type_: Optional[str]

The argument type

description: Optional[str]

The arguments description

default: Optional[str] (optional)

The default value. Defaults to ARG_DESCRIPTOR_EMPTY.

property ArgumentDescriptor.descriptor_type

Summary

The descriptor type

descriptor_type -> str

property ArgumentDescriptor.is_optional

Summary

Indicates whether the argument is optional

Description

Note that an argument is optional if it has a default value, not if it has the Optional[...] type decoration.

is_optional -> bool

class CallableDescriptor(Descriptor)

Summary

A descriptor for a callable

jetblack_markdown.metadata.callables.CallableDescriptor(
qualifier: str,
name: str,
summary: Optional[str],
description: Optional[str],
arguments: List[ArgumentDescriptor],
return_type: str,
return_description: Optional[str],
callable_type: CallableType,
is_async: bool,
is_generator: bool,
raises: Optional[List[RaisesDescriptor]],
examples: Optional[List[str]],
module: str,
package: Optional[str],
file: Optional[str]
) -> None

Parameters

qualifier: str

The qualifier part of the name

name: str

The name of the callable

summary: Optional[str]

The callables summary docstring

description: Optional[str]

The callables description docstring

arguments: List[ArgumentDescriptor]

The callables arguments

return_type: str

The callables return type

return_description: Optional[str]

The callables return description

callable_type: CallableType

The type of callable

is_async: bool

True if the callable is async

is_generator: bool

True if the callable is a generator

raises: Optional[List[RaisesDescriptor]]

A list of the exceptions raised

examples: Optional[List[str]]

A list of examples

module: str

The module name

package: Optional[str]

The package name

file: Optional[str]

The file name

property CallableDescriptor.callable_type_description

Summary

The function type name.

Description

One of: 'class', 'method', 'async generator function' 'generator function', 'function'

callable_type_description -> str

property CallableDescriptor.descriptor_type

Summary

The descriptor type

descriptor_type -> str

class method CallableDescriptor.create

Summary

Create a callable descriptor from a callable

CallableDescriptor.create(
signature: Optional[Signature],
docstring: Optional[Docstring],
callable_type: CallableType,
prefer_docstring: bool,
qualifier: Optional[str],
imported_from_all: bool
) -> CallableDescriptor

Parameters

signature: Optional[Signature]

The signature. Defaults to None.

docstring: Optional[Docstring]

The docstring. Defaults to None.

callable_type: CallableType

The function type. Defaults to CallableType.FUNCTION.

prefer_docstring: bool

If true prefer the docstring.

qualifier: Optional[str]

An overload for the qualifier. Defaults to None.

imported_from_all: bool

If true the class if defined in the __init__.py.

Returns

CallableDescriptor: A callable descriptor

class CallableType(Enum)

Summary

An enum indicating the type of a callable

jetblack_markdown.metadata.callables.CallableType(
value: Any,
names: Any,
*,
module: Any,
qualname: Any,
type: Any,
start: Any
) -> None

Parameters

value: Any
names: Any (optional)
module: Any (optional)
qualname: Any (optional)
type: Any (optional)
start: Any (optional)

class ClassDescriptor(Descriptor)

Summary

A class descriptor

jetblack_markdown.metadata.classes.ClassDescriptor(
name: str,
summary: Optional[str],
description: Optional[str],
constructor: Optional[CallableDescriptor],
attributes: List[ArgumentDescriptor],
properties: List[PropertyDescriptor],
class_methods: List[CallableDescriptor],
methods: List[CallableDescriptor],
examples: Optional[List[str]],
module: str,
package: Optional[str],
file: Optional[str],
bases: List[ClassDescription]
) -> None

Parameters

name: str

The class name

summary: Optional[str]

The docstring summary

description: Optional[str]

The docstring description

constructor: Optional[CallableDescriptor]

The constructor

attributes: List[ArgumentDescriptor]

The class attributes

properties: List[PropertyDescriptor]

The class properties

class_methods: List[CallableDescriptor]

The class methods

methods: List[CallableDescriptor]

The class methods

examples: Optional[List[str]]

Examples from the docstring

module: str

The module

package: Optional[str]

The package

file: Optional[str]

The file,

bases: List[ClassDescription]

The base classes

property ClassDescriptor.descriptor_type

Summary

The descriptor type

descriptor_type -> str

class method ClassDescriptor.create

Summary

Create a class

ClassDescriptor.create(
class_from_init: bool,
ignore_dunder: bool,
ignore_private: bool,
ignore_inherited: bool,
importing_module: Optional[str],
prefer_docstring: bool,
imported_from_all: bool
) -> ClassDescriptor

Parameters

class_from_init: bool

If True take the docstring from the init function

ignore_dunder: bool

If True ignore __XXX__ functions

ignore_private: bool

If True ignore private methods (those prefixed _XXX)

ignore_inherited: bool

If True ignore inherited methods

importing_module: Optional[str]

The importing module, defaults to None

prefer_docstring: bool

If true prefer the docstring.

imported_from_all: bool

If true the class if defined in the __init__.py.

Returns

ClassDescriptor: The class descriptor

class Descriptor

Summary

The descriptor base class

jetblack_markdown.metadata.common.Descriptor() -> None

property Descriptor.descriptor_type

Summary

The descriptor type

descriptor_type -> str

class ModuleDescriptor(Descriptor)

Summary

A module descriptor

jetblack_markdown.metadata.modules.ModuleDescriptor(
name: str,
summary: Optional[str],
description: Optional[str],
attributes: List[ArgumentDescriptor],
examples: Optional[List[str]],
package: Optional[str],
file: Optional[str],
classes: List[ClassDescriptor],
functions: List[CallableDescriptor],
modules: List[ModuleDescriptor]
) -> None

Parameters

name: str

The module name

summary: Optional[str]

The module summary

description: Optional[str]

The module description

attributes: List[ArgumentDescriptor]

The attribute list

examples: Optional[List[str]]

Examples from the docstring

package: Optional[str]

The package name

file: Optional[str]

The file name

classes: List[ClassDescriptor]

Classes in the module

functions: List[CallableDescriptor]

Functions in the module

modules: List[ModuleDescriptor]

The child modules

property ModuleDescriptor.descriptor_type

Summary

The descriptor type

descriptor_type -> str

class method ModuleDescriptor.create

Summary

Create a module descriptor

ModuleDescriptor.create(
class_from_init: bool,
ignore_dunder: bool,
ignore_private: bool,
ignore_all: bool,
ignore_inherited: bool,
prefer_docstring: bool,
follow_module_tree: bool
) -> ModuleDescriptor

Parameters

class_from_init: bool

If True take the docstring from the init function

ignore_dunder: bool

If True ignore __XXX__ functions

ignore_private: bool

If True ignore private methods (those prefixed _XXX)

ignore_all: bool

If True ignore the __all__ member.

ignore_inherited: bool
prefer_docstring: bool

If true prefer the docstring

follow_module_tree: bool

If true follow the module tree

Returns

ModuleDescriptor: A module descriptor

class PropertyDescriptor(Descriptor)

Summary

A properties descriptor

jetblack_markdown.metadata.properties.PropertyDescriptor(
qualifier: str,
name: str,
summary: Optional[str],
description: Optional[str],
type_: Optional[str],
is_settable: bool,
is_deletable: bool,
raises: Optional[List[RaisesDescriptor]],
examples: Optional[List[str]]
) -> None

Parameters

qualifier: str

The qualifier

name: str

The property name

summary: Optional[str]

The summary from the docstring

description: Optional[str]

The description from the docstring

type_: Optional[str]

The property type

is_settable: bool

If True the property can be set

is_deletable: bool

If True the property can be deleted

raises: Optional[List[RaisesDescriptor]]

A list of the exceptions the property might raise.

examples: Optional[List[str]]

A list of examples from the docstring

property PropertyDescriptor.descriptor_type

Summary

The descriptor type

descriptor_type -> str

class method PropertyDescriptor.create

Summary

Create a property descriptor from

PropertyDescriptor.create(
klass: Any,
property_name: str
) -> PropertyDescriptor

Parameters

klass: Any

The class object

property_name: str

The name of the property

Returns

PropertyDescriptor: A property descriptor

class RaisesDescriptor(Descriptor)

Summary

A raises descriptor

jetblack_markdown.metadata.raises.RaisesDescriptor(
type_: str,
description: str
) -> None

Parameters

type_: str

The type of exception raised

description: str

The exception description

property RaisesDescriptor.descriptor_type

Summary

The descriptor type

descriptor_type -> str