pyappconf.encoding package¶
Submodules¶
pyappconf.encoding.ext_json module¶
- class pyappconf.encoding.ext_json.ExtendedJSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶
Bases:
JSONEncoder
- default(o)[source]¶
Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
- Return type:
pyappconf.encoding.ext_toml module¶
pyappconf.encoding.ext_yaml module¶
- class pyappconf.encoding.ext_yaml.CustomDumper(stream, default_style=None, default_flow_style=False, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None, sort_keys=True)[source]¶
Bases:
Emitter
,Serializer
,CustomRepresenter
,Resolver
- class pyappconf.encoding.ext_yaml.CustomRepresenter(default_style=None, default_flow_style=False, sort_keys=True)[source]¶
Bases:
SafeRepresenter
- yaml_multi_representers = {<enum 'Enum'>: <function _represent_enum>, <class 'uuid.UUID'>: <function _represent_uuid>}¶
- yaml_representers = {<class 'NoneType'>: <function SafeRepresenter.represent_none>, <class 'str'>: <function SafeRepresenter.represent_str>, <class 'bytes'>: <function SafeRepresenter.represent_binary>, <class 'bool'>: <function SafeRepresenter.represent_bool>, <class 'int'>: <function SafeRepresenter.represent_int>, <class 'float'>: <function SafeRepresenter.represent_float>, <class 'list'>: <function SafeRepresenter.represent_list>, <class 'tuple'>: <function SafeRepresenter.represent_list>, <class 'dict'>: <function SafeRepresenter.represent_dict>, <class 'set'>: <function SafeRepresenter.represent_set>, <class 'datetime.date'>: <function SafeRepresenter.represent_date>, <class 'datetime.datetime'>: <function SafeRepresenter.represent_datetime>, None: <function SafeRepresenter.represent_undefined>, <class 'pathlib.Path'>: <function _represent_hasstr>, <class 'pathlib.PosixPath'>: <function _represent_hasstr>}¶