Package eido Documentation
Package Overview
Section titled “Package Overview”The eido package provides validation and filtering tools for PEPs (Portable Encapsulated Projects). It enables schema-based validation of project metadata and provides flexible filtering mechanisms.
Key Features
Section titled “Key Features”- Schema Validation: Validate PEPs against JSON schemas
- Sample Filtering: Filter samples based on custom criteria
- Config Validation: Validate project configuration separately
- Extensible Filtering: Support for custom filter plugins
- Error Reporting: Detailed validation error messages
Installation
Section titled “Installation”pip install eidoQuick Example
Section titled “Quick Example”from eido import validate_projectfrom peppy import Project
# Load a projectprj = Project("project_config.yaml")
# Validate against a schemavalidate_project(prj, "schema.yaml")API Reference
Section titled “API Reference”Validation Functions
Section titled “Validation Functions”validate_project
Section titled “validate_project”def validate_project(project: peppy.Project, schema: Union[str, dict]) -> NoneValidate a project object against a schema
:param peppy.Project project: a project object to validate :param str | dict schema: schema dict to validate against or a path to one from the error. Useful when used ith large projects
:return: None :raises EidoValidationError: if validation is unsuccessful
validate_sample
Section titled “validate_sample”def validate_sample(project: peppy.Project, sample_name: Union[str, int], schema: Union[str, dict]) -> NoneValidate the selected sample object against a schema
:param peppy.Project project: a project object to validate :param str | int sample_name: name or index of the sample to validate :param str | dict schema: schema dict to validate against or a path to one
:raises EidoValidationError: if validation is unsuccessful
validate_config
Section titled “validate_config”def validate_config(project: Union[peppy.Project, dict], schema: Union[str, dict]) -> NoneValidate the config part of the Project object against a schema
:param peppy.Project project: a project object to validate :param str | dict schema: schema dict to validate against or a path to one
Schema Functions
Section titled “Schema Functions”read_schema
Section titled “read_schema”def read_schema(schema)Safely read schema from YAML-formatted file.
If the schema imports any other schemas, they will be read recursively.
:param str | Mapping schema: path to the schema file or schema in a dict form :return list[dict]: read schemas :raise TypeError: if the schema arg is neither a Mapping nor a file path or if the 'imports' sections in any of the schemas is not a list
Exceptions
Section titled “Exceptions”EidoValidationError
Section titled “EidoValidationError”class EidoValidationError(message, errors_by_type)Bases: EidoException
Object was not validated successfully according to schema.