yaspop package

Submodules

yaspop.common module

class yaspop.common.RequiredValueType

Bases: object

yaspop.common.bind(func, pre=(), post=(), kwpre={}, kwpost={})[source]
class yaspop.common.classproperty[source]

Bases: property

yaspop.common.dbg_print(*args, **kargs)[source]
yaspop.common.hasws(txt)[source]
yaspop.common.is2tuple(obj, i=None)[source]

Returns True if obj is a 2-tuple , otherwise False.

yaspop.common.isbool(obj)[source]

Returns True if type(obj) is bool, otherwise False.

yaspop.common.isfloat(obj)[source]

Returns True if type(obj) is float, otherwise False.

yaspop.common.isint(obj)[source]

Returns True if type(obj) is int, otherwise False.

yaspop.common.isiterable(obj)[source]

Returns True if obj is instance of Iterable, otherwise False.

yaspop.common.ismap(obj)[source]

Returns True if obj is instance of Mapping, 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.isntuple(obj, n, i=None)[source]

Returns True if obj is a n-tuple , otherwise False.

yaspop.common.isnumeric(obj)[source]

Returns True if obj is instance of Number, otherwise False.

yaspop.common.isrequired(obj)[source]

Returns True if obj is RequiredValue, otherwise False.

yaspop.common.isseq(obj)[source]

Returns True if obj is instance of Sequence, otherwise False.

yaspop.common.isstr(obj)[source]

Returns True if type(obj) is str, otherwise False.

yaspop.common.stripsplit(txt, sep=None, maxsplit=-1, chars=None)[source]
yaspop.common.toseq(obj, t=<class 'tuple'>)[source]

convert non-tuple values to a 1-tuple containing original value.

yaspop.common.uniques(*sources, target=None)[source]
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.common.wordjoin(seq, sep=', ', lastsep=' or ', repr=<built-in function repr>)[source]

yaspop.settings module

class yaspop.settings.Setting(name, default=None, getter=True, setter=None, deleter=None, doc='Undocumented')[source]

Bases: property

classmethod Factory(clsname, cast, bases=None, mixins=None, tag=None)[source]
default
classmethod tag()[source]
class yaspop.settings.SettingMap[source]

Bases: collections.abc.Mapping

classmethod Factory(name, settings, base=None, repr_=None)[source]

yaspop.yaspop module

Main module.

Module contents

Top-level package for YASPOP.