zeff.validator package

Submodules

zeff.validator.generic module

Zeff Validator.

class zeff.validator.generic.RecordGenericValidator(*argv, **kwargs)[source]

Bases: zeff.validator.record.RecordValidator

Zeff Generic Record Validator.

See RecordValidator.

reset()[source]

See RecordValidator.reset.

validate_record(record: zeff.record.record.Record)[source]

See RecordValidator.validate_record.

validate_structured_data(data: zeff.record.structureddata.StructuredData)[source]

See RecordValidator.validate_structured_data.

validate_unstructured_data(data: zeff.record.unstructureddata.UnstructuredData)[source]

See RecordValidator.validate_unstructured_data.

zeff.validator.geospatial module

Zeff Validator.

class zeff.validator.geospatial.RecordGeospatialValidator(*argv, **kwargs)[source]

Bases: zeff.validator.generic.RecordGenericValidator

Zeff Geospatial Record Validator.

This validator will check that required items are in a geospatial record.

Warning

Only one record whould be validated at a time by a single validator object.

validate_structured_data_aggregation(names: Iterable[str])[source]

Check that latitude and longitude are available.

zeff.validator.record module

Zeff Validator.

class zeff.validator.record.RecordValidator(model: bool, logger: logging.Logger = <Logger zeffclient.record.validator (WARNING)>)[source]

Bases: object

Zeff Record Validator abstract base class.

This validator will check that required items are in a generic record.

Warning

Only one record whould be validated at a time by a single validator object.

property logger

Logger assigned to this validator.

property model

If true this validator is for dataset model records.

reset()[source]

Reset the validator to an initial state for record validation.

Subclasses must override this method if any state is stored in the validator object.

validate_properties(record: zeff.record.record.Record)[source]

Validate properties of the record.

Subclasses should override this method if record properties need validation for content.

validate_record(record: zeff.record.record.Record)[source]

Validate the entire record.

This is called last in the validation process, so anything that would require all data items to be validated first should be checked here.

validate_structured_data(data: zeff.record.structureddata.StructuredData)[source]

Validate a single structured data item.

Subclasses should override this method if values should have specific type or representation, or if other properties have limitations on values.

validate_structured_data_aggregation(names: Iterable[str])[source]

Validate that required structured data exists.

Subclasses should override this method if specific named structured data is required (e.g. geographic structured data needs latitude and longitude).

validate_unstructured_data(data: zeff.record.unstructureddata.UnstructuredData)[source]

Validate a single unstructured data item.

Subclasses should override this method to validate the data property.

zeff.validator.temporal module

Zeff Validator.

class zeff.validator.temporal.RecordTemporalValidator(model: bool, logger: logging.Logger = <Logger zeffclient.record.validator (WARNING)>)[source]

Bases: zeff.validator.record.RecordValidator

Zeff Temporal Record Validator.

This validator will check that required items are in a temporal record.

Warning

Only one record whould be validated at a time by a single validator object.

validate_filecontext(filecontext: zeff.record.file.FileContext, maxdepth)[source]

Validate a file context object.

Parameters
  • filecontext – The FileContext to validate.

  • maxdepth – Allowed depth of encapsulated subcontexts. If this is 0 then subcontexts must be empty. This will be decreased on each recursive call of this method.

validate_unstructured_data(data: zeff.record.unstructureddata.UnstructuredData)[source]

Validate a single unstructured data item.

Subclasses should override this method to validate the data property.

Module contents

ZeffClient Validator.

A validator is a filtering generator that will check each record’s state to ensure that it is valid for the type of record (e.g. geolocation record structured data needs to have latitude and longitude entries).