Validation

Validation class for ChemKED schema.

class pyked.validation.OurValidator(*args, **kwargs)[source]

Custom validator with rules for Quantities and references.

pyked.validation.compare_name(given_name, family_name, question_name)[source]

Compares a name in question to a specified name separated into given and family.

The name in question question_name can be of varying format, including “Kyle E. Niemeyer”, “Kyle Niemeyer”, “K. E. Niemeyer”, “KE Niemeyer”, and “K Niemeyer”. Other possibilities include names with hyphens such as “Chih-Jen Sung”, “C. J. Sung”, “C-J Sung”.

Examples

>>> compare_name('Kyle', 'Niemeyer', 'Kyle E Niemeyer')
True
>>> compare_name('Chih-Jen', 'Sung', 'C-J Sung')
True
Parameters:
  • given_name (str) – Given (or first) name to be checked against.

  • family_name (str) – Family (or last) name to be checked against.

  • question_name (str) – The whole name in question.

Returns:

The return value. True for successful comparison, False otherwise.

Return type:

bool

pyked.validation.units = <pint.registry.UnitRegistry object>

Unit registry to contain the units used in PyKED