util Module

util Module

Various general utilities used in the panel codebase.

panel.util.abbreviated_repr(value, max_length=25, natural_breaks=',', ' ')[source]

Returns an abbreviated repr for the supplied object. Attempts to find a natural break point while adhering to the maximum length.


Safely casts any object to unicode including regular string (i.e. bytes) types in python 2.

panel.util.full_groupby(l, key=<function <lambda>>)[source]

Groupby implementation which does not require a prior sort


Returns the instance owning the supplied instancemethod or the class owning the supplied classmethod.

panel.util.indexOf(obj, objs)[source]

Returns the index of an object in a list of objects. Unlike the list.index method this function only checks for identity not equality.

panel.util.isIn(obj, objs)[source]

Checks if the object is in the list of objects safely.


Whether an object is a Parameterized class or instance.


Whether the array or scalar is recognized datetime type.


Safe version of os.path.isfile robust to path length issues on Windows


Removes the integer id from a Parameterized class name.

panel.util.param_reprs(parameterized, skip=None)[source]

Returns a list of reprs for parameters on the parameterized object. Skips default and empty values.

panel.util.recursive_parameterized(parameterized, objects=None)[source]

Recursively searches a Parameterized object for other Parmeterized objects.


Returns a repr without the unicode prefix.


Retrieve the value tuple as a tuple of datetime objects.