A YAML parser that resolves JSON references
Project description
yamole
Dig through the JSON references inside a YAML file, the kind of situation you may run into when parsing OpenAPI files.
The result is a single, big YAML file with all the references resolved (i.e. with their contents replaced in the corresponding places).
Installation
yamole is available as a PyPI module, so you can install it using pip
:
$ pip install yamole
Usage
Using yamole is pretty straightforward. The parser is available through the
YamoleParser
class:
parser = YamoleParser('input_file.yaml')
output_str = parser.dumps()
Testing
To test that yamole works properly, you can run:
$ pip install -r requirements.txt
$ python tests/test.py
This will run the parser against a specific test case that makes use of all of
yamole's features, and will compare the result with a fixture
(tests/expected.yaml
).
(c) 2018 Yago González. All rights reserved
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for yamole-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9e3cec02407eb576e4018cc101054b314cacaa2c9588320731d9d3c981a05fa |
|
MD5 | 52595599175671764a0c6d8989764acf |
|
BLAKE2b-256 | c7a631849fa23d19fc1c09f39a7e140f8e55827cbc50660e9b88bf25bc3ccb23 |