Soup objects
This file defines soup objects. PySoup
derives soup objects from their ast
equivalents and stores them in its objects
attribute. These are designed to
be relatively easy to compile in a markdown file.
docstr_md.python.Expr
class docstr_md.python.Expr(obj, parser='sklearn') [source]
Stores an expression.
Parameters: | obj : ast.Expr
Expression object from which this is derived. parser : callable or str, default='sklearn'
If input as a string, |
---|---|
Attributes: | ast : ast.Expr
Original
Parsed docstring dictionary, output by the |
docstr_md.python.FunctionDef
class docstr_md.python.FunctionDef(obj, parser='sklearn') [source]
Stores a function.
Parameters: | obj : ast.FunctionDef
Function object from which this is derived. parser : callable or str, default='sklearn'
If input as a string, |
---|---|
Attributes: | ast : ast.FunctionDef
Original Name of the function. docstr : dict
Parsed docstring dictionary, output by the
Python formatted import path, e.g.
Path to file in the source code. e.g.
Takes |
Methods
is_property(self) [source]
Indicates that this function is a getter, setter, or deleter.
i.e. This function is a method of a class decorated with
@property
, @x.setter
, or @x.deleter
.
Returns: | is_property : bool
Indicator that this function is a property. |
---|
docstr_md.python.ClassDef
class docstr_md.python.ClassDef(obj, parser='sklearn') [source]
Stores a class.
Parameters: | obj : ast.ClassDef
Class object from which this is derived. parser : callable or str, default='sklearn'
If input as a string, |
---|---|
Attributes: | ast : ast.ClassDef
Original Name of the class. docstr : dict
Parsed docstring dictionary, output by the
Python formatted import path, e.g.
Path to file in the source code. e.g.
Takes
List of class methods as Class constructor. |
Methods
rm_properties(self) [source]
Remove methods with getter, setter, and deleter decorators.
Returns: | self : docstr_md.python.soup_objects.ClassDef
|
---|
rm_methods(self, *names) [source]
Remove methods by name.
Parameters: | *names : str
Method names to remove. |
---|---|
Returns: | self : docstr_md.python.ClassDef
|
keep_methods(self, *names) [source]
Keep methods by name.
Parameters: | *names : str
Method names to keep. |
---|---|
Returns: | self : docstr_md.python.ClassDef
|