This package contains the validation logic to validate the data of the BO4E migration model
ibims.
It uses the pedantic-validator-framework to
create ValidationManager
s for each data set in
ibims.
(Currently supported are only Customer
, Network
and Resource
.)
This package is designed to be used together with bomf.
Although, it only uses the MigrationConfig
to use the migration_key_date
which is necessary for some validations.
Install it from pypi:
pip install pvtool
To use the validation logic you just need to bind the preconfigured modules of this package to
ValidationManager
of your Injector
. Alternatively, you could execute the provider-method of the
module on your own by supplying a MigrationConfig
instance.
from injector import Injector
from pvtool import ValidationManagerProviderCustomer
from pvframework import ValidationManager
from bomf.config import MigrationConfig
from datetime import datetime, UTC
customer_injector = Injector([
ValidationManagerProviderCustomer,
lambda binder: binder.bind(MigrationConfig, MigrationConfig(migration_key_date=datetime(2021, 1, 1, tzinfo=UTC))),
])
customer_validation_manager = customer_injector.get(ValidationManager)
Follow the instructions in our Python template repository.
You are very welcome to contribute to this repository by opening a pull request against the main branch.