master > master: code py - models + config implementiert
This commit is contained in:
43
code/python/src/thirdparty/code.py
vendored
Normal file
43
code/python/src/thirdparty/code.py
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# IMPORTS
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
from functools import wraps;
|
||||
from functools import partial;
|
||||
from dataclasses import dataclass;
|
||||
from dataclasses import field;
|
||||
from dataclasses import Field;
|
||||
from dataclasses import asdict;
|
||||
from dataclasses import MISSING;
|
||||
from itertools import product as itertools_product;
|
||||
# cf. https://github.com/mplanchard/safetywrap
|
||||
from safetywrap import Ok;
|
||||
from safetywrap import Err;
|
||||
from safetywrap import Nothing;
|
||||
from safetywrap import Result;
|
||||
from safetywrap import Option;
|
||||
from safetywrap import Some;
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# EXPORTS
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
__all__ = [
|
||||
'partial',
|
||||
'wraps',
|
||||
'asdict',
|
||||
'dataclass',
|
||||
'field',
|
||||
'Field',
|
||||
'MISSING',
|
||||
'itertools_product',
|
||||
'Err',
|
||||
'Nothing',
|
||||
'Ok',
|
||||
'Option',
|
||||
'Result',
|
||||
'Some',
|
||||
];
|
||||
16
code/python/src/thirdparty/config.py
vendored
16
code/python/src/thirdparty/config.py
vendored
@@ -6,10 +6,12 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
import json;
|
||||
import jsonschema;
|
||||
from lazy_load import lazy;
|
||||
from yaml import add_constructor;
|
||||
from yaml import load;
|
||||
from yaml import Loader;
|
||||
from yaml import FullLoader;
|
||||
from yaml import load as yaml_load;
|
||||
from yaml import FullLoader as yaml_FullLoader;
|
||||
from yaml import add_path_resolver as yaml_add_path_resolver;
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# EXPORTS
|
||||
@@ -17,8 +19,10 @@ from yaml import FullLoader;
|
||||
|
||||
__all__ = [
|
||||
'json',
|
||||
'jsonschema',
|
||||
'lazy',
|
||||
'add_constructor',
|
||||
'load',
|
||||
'Loader',
|
||||
'FullLoader',
|
||||
'yaml_load',
|
||||
'yaml_FullLoader',
|
||||
'yaml_add_path_resolver',
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user