EMLvp (validator and parser)
Project description
EMLvp (validator and parser)
A Python 3 library to validate and parse Ecological Metadata Lanaguage XML documents for compliance (see the official EML documentation for reference: https://eml.ecoinformatics.org/validation-and-content-references.html)
The EMLvp package is both a command line interface (CLI) application that can be used in a local environment and an
EML validation and parsing API that may be imported into other Python modules. The CLI application, emlvp
, is also
used as a reference implementation for the emlvp API. The EMLvp package API provides three object classes that 1)
perform XML schema validation - Validator
, 2) EML compliance parsing - Parser
, and 3) dereference EML
<references>
elements into their normalized structures - Derefencer
. (see
here for details)
Compliance includes the following inspections:
id
attributes in all elements are unique,references
elements for subjectid
,- for circular
references
(references
parent elements withid
attributes), - for
system
attribute consistency, customUnit
for STMML definitions,- parents of
annotation
elements for subjectid
(sans the annotations element), references
attribute of annotation(s) for subject id, andadditionalMetadata
describes
attribute for subject id.
The emlvp
application accepts an Ecological Metadata Language XML document file as input or a directory containing
EML XML document files with a “.xml” file extension. Once an EML XML document is identified, the application will
immediately perform a schema (and other) validation inspection followed by EML compliance parsing that inspects the
document for compliance beyond what is possible with XML schema validation (see
EML normative documents for details).
Usage: emlvp [OPTIONS] TARGET...
Performs validation of EML XML file(s)
1. XML schema validation
2. EML parsing for references/id resolution
3. Dereference references/id into expanded EML XML and re-validate/parse
TARGET: EML XML file or directory containing EML XML file(s) (may be repeated)
Options:
-d, --dereference Dereference EML XML file(s) (default is False).
-f, --fail-fast Exit on first exception encountered (default is False).
-p, --pretty-print Pretty print output for dereferenced EML XML (default is
False).
-s, --statistics Show post processing inspection statistics.
-v, --verbose Send output to standard out (-v or -vv or -vvv for
increasing output).
-h, --help Show this message and exit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.