Skip to content

Package eido Documentation

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.

  • 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
Terminal window
pip install eido
from eido import validate_project
from peppy import Project
# Load a project
prj = Project("project_config.yaml")
# Validate against a schema
validate_project(prj, "schema.yaml")

def validate_project(project: peppy.Project, schema: Union[str, dict]) -> None

Validate 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

def validate_sample(project: peppy.Project, sample_name: Union[str, int], schema: Union[str, dict]) -> None

Validate 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

def validate_config(project: Union[peppy.Project, dict], schema: Union[str, dict]) -> None

Validate 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

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

class EidoValidationError(message, errors_by_type)

Bases: EidoException

Object was not validated successfully according to schema.

  • errors_by_type
  • message