pyxsdtestdata
Package for managing XSD test data
This package provides methods for managing test data from the xsdtests database.
The XSDTestData class is used to initialise and manage the datasets.
This package is a wrapper for the xsdtestdata Rust crate.
- class pyxsdtestdata.XSDTestData(database_dir, archive_path)
Class for managing XSD Test Data from the xsdtests database.
The class manages the data in the xsdtests database. When initialised, the class searches for the database at the
database_dir. If found, it builds the object using the contents of this directory.If the
database_dir`does not exist, the class searches for an archive file atarchive_path. If this is found, it extracts the contents todatabase_dir. Otherwise, it downloads the archive from the xsdtests repo.This class is a wrapper for the
xsdtestdata::XSDTestData.- Parameters:
database_dir (pathlib.Path) – Path to the (current or target) directory for the database.
archive_path (pathlib.Path) – Path to the zip file containing the database
- Returns:
Data about all XSD files in the database
- Return type:
- Raises:
RuntimeError – Error while setting up the database
- class pyxsdtestdata.XSDData
XSD Data Class containing information about a single XSD file
Includes data about an XSD file, including:
Path to file
Data set it belongs to
Validity of XSD
No constructor is included, instances are created by the
XSDTestDataclass. The class provides Python bindings for the rust:struct:xsdtestdata::XSDData Rust struct and its methods.- key()
Get the unique key associated with the XSD file
- Returns:
Unique key for the file in the test set
- Return type:
- path()
Get the filepath of the XSD file
- Returns:
Path to XSD file
- Return type:
- pyxsdtestdata.version()
Return the version of the
xmlgeneratorRust crate- Returns:
The version of the Rust crate
- Return type: