pyre.schemata¶
Submodules¶
pyre.schemata.Arraypyre.schemata.Booleanpyre.schemata.Catalogpyre.schemata.Complexpyre.schemata.Componentpyre.schemata.Containerpyre.schemata.Datepyre.schemata.Decimalpyre.schemata.Dimensionalpyre.schemata.EnvPathpyre.schemata.EnvVarpyre.schemata.Floatpyre.schemata.Fractionpyre.schemata.INetpyre.schemata.InputStreampyre.schemata.Integerpyre.schemata.Listpyre.schemata.Mappingpyre.schemata.Numericpyre.schemata.OutputStreampyre.schemata.Pathpyre.schemata.Schemapyre.schemata.Sequencepyre.schemata.Setpyre.schemata.Stringpyre.schemata.Timepyre.schemata.Timestamppyre.schemata.Tuplepyre.schemata.Typedpyre.schemata.URIpyre.schemata.exceptions
Package Contents¶
-
class
pyre.schemata.identity(default=None, **kwds)¶ The base class for type declarators
-
typename= identity¶
-
coerce(self, value, **kwds)¶ Convert the given value into a python native object
-
string(self, value)¶ Render value as a string that can be persisted for later coercion
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.bool(default=True, **kwds)¶ Bases:
pyre.schemata.Numeric.NumericA type declarator for booleans
-
typename= bool¶
-
complaint= could not coerce {0.value!r} to bool¶
-
xlat¶
-
coerce(self, value, **kwds)¶ Convert {value} into a boolean
-
-
class
pyre.schemata.complex(default=complex(), **kwds)¶ Bases:
pyre.schemata.Numeric.NumericA type declarator for complex numbers
-
typename= complex¶
-
complaint= could not coerce {0.value!r} into a complex number¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a complex number
-
-
class
pyre.schemata.decimal(default=decimal.Decimal(), **kwds)¶ Bases:
pyre.schemata.Numeric.NumericA type declarator for fixed point numbers
-
typename= decimal¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a decimal
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.float(default=float(), **kwds)¶ Bases:
pyre.schemata.Numeric.NumericA type declarator for floats
-
typename= float¶
-
complaint= could not coerce {0.value!r} into a float¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a float
-
-
class
pyre.schemata.fraction(default=fractions.Fraction(), **kwds)¶ Bases:
pyre.schemata.Numeric.NumericA type declarator for fixed point numbers
-
typename= fraction¶
-
ncomplaint= could not coerce {0.value!r) into a fraction¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a fraction
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.inet(default=any, **kwds)¶ Bases:
pyre.schemata.Schema.SchemaA type declarator for internet addresses
-
address¶
-
any¶
-
typename= inet¶
-
complaint= could not coerce {0.value!r} into an internet address¶
-
regex¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a internet address
-
recognize(self, family, address)¶ Return an appropriate address type based on the socket family
-
parse(self, value)¶ Convert {value}, expected to be a string, into an inet address
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.int(default=int(), **kwds)¶ Bases:
pyre.schemata.Numeric.NumericA type declarator for integers
-
typename= int¶
-
complaint= could not coerce {0.value!r} into an integer¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into an integer
-
-
class
pyre.schemata.str(default=str(), **kwds)¶ Bases:
pyre.schemata.Schema.SchemaA type declarator for strings
-
typename= str¶
-
complaint= could not coerce {0.value!r} into a string¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a string
-
-
class
pyre.schemata.date(default=datetime.date.today(), format=format, **kwds)¶ Bases:
pyre.schemata.Schema.SchemaA type declarator for dates
-
format= %Y-%m-%d¶
-
typename= date¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a date
-
string(self, value)¶ Render value as a string that can be persisted for later coercion
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.dimensional(default=units.zero, **kwds)¶ Bases:
pyre.schemata.Numeric.NumericA type declarator for quantities with units
-
typename= dimensional¶
-
complaint= could not coerce {0.value!r} into a dimensional quantity¶
-
parser¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a dimensional
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.path¶ Bases:
pyre.schemata.Schema.SchemaA type declarator for paths
-
typename= path¶
-
complaint= cannot cast {0.value!r} into a path¶
-
cwd¶
-
root¶
-
home¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a path
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.time(default=datetime.datetime.today(), format=format, **kwds)¶ Bases:
pyre.schemata.Schema.SchemaA type declarator for timestamps
-
format= %H:%M:%S¶
-
typename= time¶
-
complaint= could not coerce {0.value!r} into a time¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a timestamp
-
string(self, value)¶ Render value as a string that can be persisted for later coercion
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.timestamp(default=datetime.datetime.today(), format=format, **kwds)¶ Bases:
pyre.schemata.Schema.SchemaA type declarator for timestamps
-
format= %Y-%m-%d %H:%M:%S¶
-
typename= timestamp¶
-
complaint= could not coerce {0.value!r} into a time¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a timestamp
-
string(self, value)¶ Render value as a string that can be persisted for later coercion
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.uri(default=locator(), scheme=None, authority=None, address=None, **kwds)¶ Bases:
pyre.schemata.Schema.SchemaParser for resource identifiers
-
typename= uri¶
-
complaint= could not coerce {0.value!r} into a URI¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a resource locator
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.sequence¶ Bases:
pyre.schemata.Container.ContainerThe base class for type declarators that are sequences of other types
-
open= [({¶
-
close= ])}¶
-
delimiter= ,¶
-
typename= sequence¶
-
container¶
-
complaint= could not coerce {0.value!r} as a sequence¶
-
str(self, value)¶ Render value as a string that can be persisted for later coercion
-
json(self, value)¶ Generate a JSON representation of {value}
-
_coerce(self, value, incognito=True, **kwds)¶ Convert {value} into an iterable
-
-
class
pyre.schemata.array(default=(), **kwds)¶ Bases:
pyre.schemata.Schema.SchemaThe array type declarator
-
typename= array¶
-
complaint= could not coerce {0.value!r} to an array¶
-
coerce(self, value, **kwds)¶ Convert {value} into a tuple
-
-
class
pyre.schemata.list¶ Bases:
pyre.schemata.Sequence.SequenceThe list type declarator
-
typename= list¶
-
container¶
-
-
class
pyre.schemata.set¶ Bases:
pyre.schemata.Sequence.SequenceThe set type declarator
-
typename= set¶
-
container¶
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.tuple¶ Bases:
pyre.schemata.Sequence.SequenceThe tuple type declarator
-
typename= tuple¶
-
container¶
-
-
class
pyre.schemata.mapping¶ Bases:
pyre.schemata.Container.ContainerThe base class for type declarators that map strings to other types
-
typename= mapping¶
-
container¶
-
complaint= could not coerce {0.value!r} to a mapping¶
-
_coerce(self, value, **kwds)¶ Convert {value} into a container
-
-
class
pyre.schemata.catalog¶ Bases:
pyre.schemata.Mapping.MappingThe catalog type declarator
-
typename= catalog¶
-
-
class
pyre.schemata.component(protocol, default=default, **kwds)¶ Bases:
pyre.schemata.Schema.SchemaA type declarator for components
-
default¶
-
complaint= could not coerce {0.value!r} into a component¶
-
protocol¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into a component class compatible with my protocol
-
string(self, value)¶ Render value as a string that can be persisted for later coercion
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.istream(default='stdin', mode=mode, **kwds)¶ Bases:
pyre.schemata.Schema.Schema,pyre.framework.Dashboard.DashboardA representation of input streams
-
mode= r¶
-
typename= istream¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into an open input stream
-
string(self, value)¶ Render value as a string that can be persisted for later coercion
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.ostream(default='stdout', mode=mode, **kwds)¶ Bases:
pyre.schemata.Schema.Schema,pyre.framework.Dashboard.DashboardA representation of input streams
-
mode= w¶
-
typename= ostream¶
-
coerce(self, value, **kwds)¶ Attempt to convert {value} into an open input stream
-
string(self, value)¶ Render value as a string that can be persisted for later coercion
-
json(self, value)¶ Generate a JSON representation of {value}
-
-
class
pyre.schemata.envvar(variable, **kwds)¶ Bases:
pyre.schemata.String.StringA type declarator for strings whose default values are associated with an environment variable
-
typename= envvar¶
-
-
class
pyre.schemata.envpath(variable, pathsep=pathsep, **kwds)¶ Bases:
pyre.schemata.List.ListA list of paths whose default value is tied to the value of an environment variable
-
typename= envpath¶
-
pathsep¶
-
_coerce(self, value, **kwds)¶ Convert {value} into an iterable
-
-
pyre.schemata.basic¶
-
pyre.schemata.composite¶
-
pyre.schemata.containers¶
-
pyre.schemata.meta¶
-
pyre.schemata.schemata¶
-
pyre.schemata.sequences¶
-
pyre.schemata.mappings¶
-
pyre.schemata.numeric¶