If you install `nomad-lab[parsers]`, you can use the NOMAD parsers locally on your computer.
To use the NOMAD parsers from the command line, you can use the parse CLI 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 basic metadata) and `--show-archive` (a JSON representation of the full parse results).
You can also use the NOMAD parsers within Python, as shown below. This will give you the parse results as metainfo objects to conveniently analyze the results in Python. See metainfo for more details on how to use the metainfo in Python.
```python
importsys
fromnomad.clientimportparse,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.run[0]
# get the same data as JSON serializable Python dict
python_dict=section_run.m_to_dict()
```
You can also clone a parser project to debug or fix a parser:
Our parsers are hosted in github. They are in the [nomad-coe](https://github.com/nomad-coe) organization. They are typically named `nomad-parser-<code-name>`. The parser version
that fits the NOMAD v1 metainfo schema is typically in the `metainfo-refactor` branch.
Run the CLI with `python -m nomad.cli` to automatically include the current working directory
in the Python path. This will use the cloned parser code over the installed parser code.
NOMAD provides a Python package called `nomad-lab`.
## Install
The package is hosted on [pypi](https://pypi.org/project/nomad-lab/)
and you can install it with *pip* (or conda).
...
...
@@ -42,52 +40,3 @@ The various extras have the following meaning:
-*dev*, additional tools that are necessary to develop NOMAD
-*all*, all of the above
## Access parsed NOMAD data with `ArchiveQuery`
The `ArchiveQuery` allows you to search for entries and access their parsed *archive* data
at the same time. Furthermore, all data is accessible through a convenient Python interface
based on the [NOMAD metainfo](archive.md) rather than plain JSON.
Please check [this page](async_archive.md) for details.
## Use NOMAD parser locally
If you install `nomad-lab[parsers]`, you can use the NOMAD parsers locally on your computer.
To use the NOMAD parsers from the command line, you can use the parse CLI 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 basic metadata) and `--show-archive` (a JSON representation of the full parse results).
You can also use the NOMAD parsers within Python, as shown below. This will give you the parse results as metainfo objects to conveniently analyze the results in Python. See metainfo for more details on how to use the metainfo in Python.
```python
importsys
fromnomad.clientimportparse,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.run[0]
# get the same data as JSON serializable Python dict
python_dict=section_run.m_to_dict()
```
You can also clone a parser project to debug or fix a parser:
Our parsers are hosted in github. They are in the [nomad-coe](https://github.com/nomad-coe) organization. They are typically named `nomad-parser-<code-name>`. The parser version
that fits the NOMAD v1 metainfo schema is typically in the `metainfo-refactor` branch.
Run the CLI with `python -m nomad.cli` to automatically include the current working directory
in the Python path. This will use the cloned parser code over the installed parser code.