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()
parser.data['some-key'] # The dict with the parsed file's structure
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 Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yamole-2.0.0.tar.gz.
File metadata
- Download URL: yamole-2.0.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da559324782950c9ae5658a746a22be22e4ac4b9c0c13fd98917f9381f8d6b7e
|
|
| MD5 |
5447549bacee75457be0e2882f7cf9c6
|
|
| BLAKE2b-256 |
25ef158d98c17e8f4641d8a2a33334462985f7a98f1051e094c1b8ce2e8501c0
|
File details
Details for the file yamole-2.0.0-py3-none-any.whl.
File metadata
- Download URL: yamole-2.0.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e8cfd5824d0650ac35a6c337681ea0af632ad3b759d3ee8b96a41410363eb40
|
|
| MD5 |
e430c1985c821d7bac8d87f005d89578
|
|
| BLAKE2b-256 |
6058925f1631748d5f2e3defc6e3c70d8ebc6fe2d985e2ae8f0a229d23ad0ec3
|