master > master: code py - models + config implementiert

This commit is contained in:
RD
2022-06-10 11:50:59 +02:00
parent 67f6caf2d5
commit 0523c68100
21 changed files with 538 additions and 94 deletions

43
code/python/src/thirdparty/code.py vendored Normal file
View 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',
];

View File

@@ -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',
];