Skip to content

Commit

Permalink
Polish readme and remove lark's remnants
Browse files Browse the repository at this point in the history
  • Loading branch information
blokhin committed Apr 15, 2024
1 parent c6a0745 commit 4b82d4a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
10 changes: 0 additions & 10 deletions Makefile

This file was deleted.

24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
# pytopas

This is the parser for Bruker's TOPAS macro language. We have compared two canonical parsing approaches for Python: `lark` vs. `pyparsing`.
This is an early version of Bruker's TOPAS macro language parser, used by [commercial](https://www.bruker.com/de/products-and-solutions/diffractometers-and-x-ray-microscopes/x-ray-diffractometers/diffrac-suite-software.html) and [academic](http://www.topas-academic.net) TOPAS code. We have compared two canonical parsing approaches for Python, `lark` vs. `pyparsing`, and ended up with `pyparsing` being more convenient for debugging.


## Installation

`pip install .`

Install package with optional dependencies with `pip install -e .[lint,test,release]`


## Usage

Parse TOPAS input and convert it to JSON:
Parse a TOPAS macro language node with:

```sh
echo "xdd { 42 }" | topas2json - | json2topas -
```

More specifically, parse TOPAS input and convert it to JSON with:

```python
import json
Expand Down Expand Up @@ -35,7 +49,8 @@ print(src)

```

## Command line utilities

## CLI

After installing the package, two command line utilities will be available.

Expand Down Expand Up @@ -65,9 +80,6 @@ options:
```

## Development

Install package with optional dependencies: `pip install -e .[lint,test,release]`

## License

Expand Down

0 comments on commit 4b82d4a

Please sign in to comment.