yaspop package¶
Submodules¶
yaspop.common module¶
-
class
yaspop.common.
RequiredValueType
¶ Bases:
object
-
yaspop.common.
isiterable
(obj)[source]¶ Returns True if obj is instance of Iterable, otherwise False.
-
yaspop.common.
isnmoseq
(obj, n=0, m=None, c=<class 'collections.abc.Sequence'>, i=None)[source]¶ Returns True if obj is an (n..m)-c type with items of type i.
If m is None then then length can be any greater than n. If i is None then the items may be of any type. Returns True if obj is instance of Sequence, with a length between n and m, and. if m is None then length can anything more then n. if i is not None, obj’s items must be of type i; otherwise False is returned
obj (any): the subject to test. n (int): the minimum length. m (int or None): the minimum length. c (type): the container type obj must be. i (type): the type obj’s items must be.
-
yaspop.common.
isnseq
(obj, n=0, c=<class 'collections.abc.Sequence'>, i=None)[source]¶ Returns True if obj is instance of Sequence, w/length n, else False.
-
yaspop.common.
toseq
(obj, t=<class 'tuple'>)[source]¶ convert non-tuple values to a 1-tuple containing original value.
-
yaspop.common.
withdefault
(obj, default=None, types=None, name='obj')[source]¶ Return a default value if obj is None, otherwise the value.
Return a default value if obj is None, otherwise the original value. Raises ValueError if default is isrequired, or if type(obj) is not in types and not None.
Parameters: obj (any): any original value default (any): any value, or None or RequiredValue types (type or (*types)): type constrains for obj name (str): optional tag for exceptions Returns: any:The original value or default if obj is None
yaspop.settings module¶
yaspop.yaspop module¶
Main module.
Module contents¶
Top-level package for YASPOP.