Using the NOMAD parsers¶
To use the NOMAD parsers from the command line, you can use the parse
command. The
parse command will automatically match the right parser to your code output file and
run the parser. There are two output formats, --show-metadata
(a JSON representation
of the repository metadata), --show-archive
(a JSON representation of the archive data).
nomad parser --show-archive <path-to-your-mainfile-code-output-file>
You can also use the NOMAD parsers from within Python. This will give you the parse results as metainfo objects to conveniently analyse the results in Python. See metainfo for more details on how to use the metainfo in Python.
import sys
from nomad.cli.parse import parse, normalize_all
# match and run the parser
archive = parse(sys.argv[1])
# run all normalizers
normalize_all(archive)
# get the 'main section' section_run as a metainfo object
section_run = archive.section_run[0]
# get the same data as JSON serializable Python dict
python_dict = section_run.m_to_dict()