# Usage The `openschemas` python module serves several command line utils along with python functions for interacting with the set of openschemas tools. ## map2model For complete map2model usage, see the [map2model](https://www.github.com/openschemas/map2model) repository. ## Validator The validator can be called from the command line, as shown below: ``` $ openschemas validate --criteria openschemas/main/validate/criteria/dummy.yml --infile ../specifications/_specifications/Container.html Found ../specifications/_specifications/Container.html, valid name Found openschemas/main/validate/criteria/dummy.yml, valid name [criteria:dummy.yml] Found /home/vanessa/Documents/Dropbox/Code/openschemas/specifications/_specifications/Container.html, valid name [group:pass] ----- [group:fail] ----- .html` as is shown above, or if you prefer, you can load a custom data file (not necessarily a specification) as follows: ```python from openschemas.main import Client validator = Client.BasicValidator(infile="Container.yml") validator.validate_criteria(criteria="dummy.yml") ``` How to write a test? - Your tests should take, as first argument, some spec variable. It's positional so naming isn't so important. - You can either handle exiting in the function, or return False if a test fails. - You are free to use whatever logging or printing you desire! Generally, it's a good idea to provide a user with enough information to see what is being tested, and any requirements to debug if a test is not passing.