bomf
Advanced tools
| """ | ||
| models used for testing | ||
| """ | ||
| import enum | ||
| from typing import TypeVar, Union | ||
| from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt | ||
| from bo4e.com.com import COM | ||
| from pydantic import BaseModel | ||
| _SpecificBusinessObject = TypeVar("_SpecificBusinessObject", bound=Geschaeftsobjekt) | ||
| """ | ||
| an arbitrary but fixed business object type | ||
| """ | ||
| _SpecificCom = TypeVar("_SpecificCom", bound=COM) | ||
| """ | ||
| an arbitrary but fixed COM type | ||
| """ | ||
| Bo4eTyp = Union[_SpecificBusinessObject, _SpecificCom] # pylint: disable=invalid-name | ||
| # pylint:disable=too-few-public-methods | ||
| class BusinessObjectRelation(BaseModel): | ||
| """ | ||
| A business object relation describes the relation between two business object. | ||
| E.g. a relation could have the type "has_melo" where relation_part_a is a bo4e.bo.Vertrag | ||
| and relation_part_b is a bo4e.bo.Messlokation. Some relations are already defined in BO4E itself (e.g MaLo/MeLo) | ||
| or MeLo/Address. | ||
| The idea is to not enforce too much of a structure to the downstream code but still push coders to think about | ||
| necessary relation information. | ||
| """ | ||
| relation_type: enum.Enum | ||
| """ | ||
| The relation type describes how two business objects relate to each other. | ||
| This is not (only) about cardinality. It's about being able to model different relations between objects. | ||
| Think about e.g. a business partner and an address: The relation could be: | ||
| - the address is the residential address of the business partner | ||
| - the address is the invoice address of the business partner | ||
| - the address is the place where the business partner was born | ||
| All these relation types are 1:1 relations between business partners and adresses, yet they all carry different | ||
| meaning which we'd like to distinguish in our data. | ||
| """ | ||
| relation_part_a: Bo4eTyp | ||
| """ | ||
| one Business Object or COM | ||
| """ | ||
| relation_part_b: Bo4eTyp | ||
| """ | ||
| another Business Object or COM | ||
| """ |
@@ -7,3 +7,3 @@ # | ||
| # | ||
| coverage==7.4.1 | ||
| coverage==7.4.3 | ||
| # via -r dev_requirements/requirements-coverage.in |
@@ -7,10 +7,8 @@ # | ||
| # | ||
| black==24.1.1 | ||
| # via -r .\dev_requirements\requirements-formatting.in | ||
| black==24.2.0 | ||
| # via -r dev_requirements/requirements-formatting.in | ||
| click==8.1.7 | ||
| # via black | ||
| colorama==0.4.6 | ||
| # via click | ||
| isort==5.13.2 | ||
| # via -r .\dev_requirements\requirements-formatting.in | ||
| # via -r dev_requirements/requirements-formatting.in | ||
| mypy-extensions==1.0.0 | ||
@@ -17,0 +15,0 @@ # via black |
@@ -9,4 +9,2 @@ # | ||
| # via pylint | ||
| colorama==0.4.6 | ||
| # via pylint | ||
| dill==0.3.7 | ||
@@ -20,5 +18,5 @@ # via pylint | ||
| # via pylint | ||
| pylint==3.0.3 | ||
| # via -r requirements-linting.in | ||
| pylint==3.0.4 | ||
| # via -r dev_requirements/requirements-linting.in | ||
| tomlkit==0.12.3 | ||
| # via pylint |
@@ -11,6 +11,8 @@ # | ||
| # via requests | ||
| cffi==1.16.0 | ||
| # via cryptography | ||
| charset-normalizer==3.3.2 | ||
| # via requests | ||
| colorama==0.4.6 | ||
| # via build | ||
| cryptography==42.0.4 | ||
| # via secretstorage | ||
| docutils==0.20.1 | ||
@@ -24,2 +26,6 @@ # via readme-renderer | ||
| # via keyring | ||
| jeepney==0.8.0 | ||
| # via | ||
| # keyring | ||
| # secretstorage | ||
| keyring==24.3.0 | ||
@@ -39,2 +45,4 @@ # via twine | ||
| # via twine | ||
| pycparser==2.21 | ||
| # via cffi | ||
| pygments==2.17.2 | ||
@@ -46,4 +54,2 @@ # via | ||
| # via build | ||
| pywin32-ctypes==0.2.2 | ||
| # via keyring | ||
| readme-renderer==42.0 | ||
@@ -61,3 +67,5 @@ # via twine | ||
| # via twine | ||
| twine==4.0.2 | ||
| secretstorage==3.3.3 | ||
| # via keyring | ||
| twine==5.0.0 | ||
| # via -r requirements-test_packaging.in | ||
@@ -64,0 +72,0 @@ urllib3==2.1.0 |
| pytest | ||
| pytest-asyncio | ||
| bo4e==0.6.1 | ||
| # we're using this pinned version of bo4e because there's no version which contains this fix: | ||
| # https://github.com/bo4e/BO4E-python/commit/3fd45539edd7d5bfdca990775244bf31007a5ca7 |
| # | ||
| # This file is autogenerated by pip-compile with Python 3.12 | ||
| # This file is autogenerated by pip-compile with Python 3.11 | ||
| # by the following command: | ||
@@ -7,4 +7,12 @@ # | ||
| # | ||
| annotated-types==0.6.0 | ||
| # via pydantic | ||
| bo4e==0.6.1 | ||
| # via -r requirements-tests.in | ||
| colorama==0.4.6 | ||
| # via pytest | ||
| iniconfig==2.0.0 | ||
| # via pytest | ||
| iso3166==2.1.1 | ||
| # via bo4e | ||
| packaging==23.2 | ||
@@ -14,7 +22,17 @@ # via pytest | ||
| # via pytest | ||
| pytest==7.4.4 | ||
| pydantic==2.6.2 | ||
| # via bo4e | ||
| pydantic-core==2.16.3 | ||
| # via pydantic | ||
| pyhumps==3.8.0 | ||
| # via bo4e | ||
| pytest==8.0.1 | ||
| # via | ||
| # -r dev_requirements/requirements-tests.in | ||
| # -r requirements-tests.in | ||
| # pytest-asyncio | ||
| pytest-asyncio==0.23.4 | ||
| # via -r dev_requirements/requirements-tests.in | ||
| pytest-asyncio==0.23.5 | ||
| # via -r requirements-tests.in | ||
| typing-extensions==4.9.0 | ||
| # via | ||
| # pydantic | ||
| # pydantic-core |
+1
-2
| Metadata-Version: 2.1 | ||
| Name: bomf | ||
| Version: 0.10.0 | ||
| Version: 0.11.0 | ||
| Summary: BO4E Migration Framework | ||
@@ -23,3 +23,2 @@ Home-page: https://github.com/Hochfrequenz/bo4e_migration_framework | ||
| License-File: LICENSE | ||
| Requires-Dist: bo4e | ||
| Requires-Dist: pydantic>=2.0.0 | ||
@@ -26,0 +25,0 @@ Requires-Dist: typeguard>=4.0.1 |
+0
-1
@@ -1,2 +0,1 @@ | ||
| bo4e>=0.5.0 | ||
| pydantic>=2.0.0 | ||
@@ -3,0 +2,0 @@ typeguard |
+6
-12
| # | ||
| # This file is autogenerated by pip-compile with Python 3.12 | ||
| # This file is autogenerated by pip-compile with Python 3.11 | ||
| # by the following command: | ||
@@ -7,10 +7,8 @@ # | ||
| # | ||
| annotated-types==0.5.0 | ||
| annotated-types==0.6.0 | ||
| # via pydantic | ||
| bidict==0.22.1 | ||
| bidict==0.23.1 | ||
| # via | ||
| # -r requirements.in | ||
| # pvframework | ||
| bo4e==0.6.1 | ||
| # via -r requirements.in | ||
| frozendict==2.4.0 | ||
@@ -22,4 +20,2 @@ # via | ||
| # via -r requirements.in | ||
| iso3166==2.1.1 | ||
| # via bo4e | ||
| networkx==3.2.1 | ||
@@ -31,10 +27,7 @@ # via | ||
| # via -r requirements.in | ||
| pydantic==2.6.1 | ||
| pydantic==2.6.2 | ||
| # via | ||
| # -r requirements.in | ||
| # bo4e | ||
| pydantic-core==2.16.2 | ||
| pydantic-core==2.16.3 | ||
| # via pydantic | ||
| pyhumps==3.8.0 | ||
| # via bo4e | ||
| python-generics==0.0.4 | ||
@@ -50,1 +43,2 @@ # via -r requirements.in | ||
| # pydantic-core | ||
| # typeguard |
+0
-1
@@ -32,3 +32,2 @@ [metadata] | ||
| install_requires = | ||
| bo4e | ||
| pydantic>=2.0.0 | ||
@@ -35,0 +34,0 @@ typeguard>=4.0.1 |
| Metadata-Version: 2.1 | ||
| Name: bomf | ||
| Version: 0.10.0 | ||
| Version: 0.11.0 | ||
| Summary: BO4E Migration Framework | ||
@@ -23,3 +23,2 @@ Home-page: https://github.com/Hochfrequenz/bo4e_migration_framework | ||
| License-File: LICENSE | ||
| Requires-Dist: bo4e | ||
| Requires-Dist: pydantic>=2.0.0 | ||
@@ -26,0 +25,0 @@ Requires-Dist: typeguard>=4.0.1 |
@@ -1,2 +0,1 @@ | ||
| bo4e | ||
| pydantic>=2.0.0 | ||
@@ -3,0 +2,0 @@ typeguard>=4.0.1 |
@@ -54,2 +54,3 @@ .gitignore | ||
| unittests/example_source_data.json | ||
| unittests/models.py | ||
| unittests/test_bo4e_data_set.py | ||
@@ -56,0 +57,0 @@ unittests/test_entity_loader.py |
@@ -13,3 +13,3 @@ """ | ||
| from generics import get_filled_type | ||
| from pydantic import BaseModel, TypeAdapter, ConfigDict, ValidationError # pylint:disable=no-name-in-module | ||
| from pydantic import BaseModel, ConfigDict, TypeAdapter, ValidationError # pylint:disable=no-name-in-module | ||
@@ -16,0 +16,0 @@ _TargetEntity = TypeVar("_TargetEntity") |
@@ -5,57 +5,8 @@ """ | ||
| import enum | ||
| import uuid | ||
| from abc import ABC | ||
| from typing import TypeVar, Union | ||
| from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt | ||
| from bo4e.com.com import COM | ||
| from pydantic import BaseModel, Field # pylint: disable=no-name-in-module | ||
| _SpecificBusinessObject = TypeVar("_SpecificBusinessObject", bound=Geschaeftsobjekt) | ||
| """ | ||
| an arbitrary but fixed business object type | ||
| """ | ||
| _SpecificCom = TypeVar("_SpecificCom", bound=COM) | ||
| """ | ||
| an arbitrary but fixed COM type | ||
| """ | ||
| Bo4eTyp = Union[_SpecificBusinessObject, _SpecificCom] # pylint: disable=invalid-name | ||
| # pylint:disable=too-few-public-methods | ||
| class BusinessObjectRelation(BaseModel): | ||
| """ | ||
| A business object relation describes the relation between two business object. | ||
| E.g. a relation could have the type "has_melo" where relation_part_a is a bo4e.bo.Vertrag | ||
| and relation_part_b is a bo4e.bo.Messlokation. Some relations are already defined in BO4E itself (e.g MaLo/MeLo) | ||
| or MeLo/Address. | ||
| The idea is to not enforce too much of a structure to the downstream code but still push coders to think about | ||
| necessary relation information. | ||
| """ | ||
| relation_type: enum.Enum | ||
| """ | ||
| The relation type describes how two business objects relate to each other. | ||
| This is not (only) about cardinality. It's about being able to model different relations between objects. | ||
| Think about e.g. a business partner and an address: The relation could be: | ||
| - the address is the residential address of the business partner | ||
| - the address is the invoice address of the business partner | ||
| - the address is the place where the business partner was born | ||
| All these relation types are 1:1 relations between business partners and adresses, yet they all carry different | ||
| meaning which we'd like to distinguish in our data. | ||
| """ | ||
| relation_part_a: Bo4eTyp | ||
| """ | ||
| one Business Object or COM | ||
| """ | ||
| relation_part_b: Bo4eTyp | ||
| """ | ||
| another Business Object or COM | ||
| """ | ||
| class Bo4eDataSet(BaseModel, ABC): | ||
@@ -62,0 +13,0 @@ """ |
@@ -8,5 +8,7 @@ import enum | ||
| from bomf.model import Bo4eDataSet, Bo4eTyp, BusinessObjectRelation | ||
| from bomf.model import Bo4eDataSet | ||
| from .models import Bo4eTyp, BusinessObjectRelation | ||
| class _GeschaeftspartnerAdresseRelation(enum.Enum): | ||
@@ -13,0 +15,0 @@ HAS_LIEFERANSCHRIFT = 1 |
| from typing import Optional, Type | ||
| from pydantic import BaseModel | ||
| import pytest # type:ignore[import] | ||
| from bo4e.bo.marktlokation import Marktlokation | ||
| from bo4e.bo.messlokation import Messlokation | ||
| from pydantic import BaseModel | ||
| from bomf.mapper import Bo4eDataSetToTargetMapper, PaginationNotSupportedException, SourceToBo4eDataSetMapper | ||
| from bomf.model import Bo4eTyp | ||
| from .models import Bo4eTyp | ||
| class _NotImplementedBo4eDataSetMixin: | ||
@@ -13,0 +14,0 @@ """ |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
115394
0.45%62
1.64%1558
0.32%