Metadata-Version: 2.1
Name: cvldoc_parser
Version: 2.0.0b2
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.7
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# CVLDoc Parser: Python module
Exposes a Python API for the CVLDoc module. WIP.

## Usage
First, make sure **Rust 1.62** or newer is installed.
Clone [the entire repo](https://github.com/Certora/cvldoc_parser), then from the project base:
```bash
$ cd src/python_wrapper
$ python -m venv .env
$ source .env/bin/activate
$ pip install maturin
```
It creates a virtual environment for development, and should only be done once. 
Now, while the `.env` is sourced, it is possible to run
```bash
$ maturin build
```
in order to build the module, which can then be used in the `virtualenv` or installed globally with `pip install {generated .whl file}`. It is also possible to run `maturin develop` in order to generate a temporary module.

It is now possible to import the module:
```bash
$ python
>>> import cvldoc_parser
```

## API
Currently exposes a single function, `cvldoc_parser.parse(paths)`. It takes a list of file paths as strings, and returns a list of parsed CVLDoc objects for each path.
A parsed CVLDoc object is either a `Documentation` or a `FreeForm`. They both support a `diagnostics()` method, that returns a list of warnings or errors associated with that object.
