https://github.com/szikszail/yamltopy
A Python CLI tool to convert YAML file to Python module for better load performance
https://github.com/szikszail/yamltopy
hacktoberfest python yaml
Last synced: over 1 year ago
JSON representation
A Python CLI tool to convert YAML file to Python module for better load performance
- Host: GitHub
- URL: https://github.com/szikszail/yamltopy
- Owner: szikszail
- License: mit
- Created: 2021-03-10T19:01:56.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-12T20:48:16.000Z (over 5 years ago)
- Last Synced: 2025-02-28T04:00:10.487Z (over 1 year ago)
- Topics: hacktoberfest, python, yaml
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yamltopy



## Install
```shell
pip install yamltopy
```
## Usage
```
usage: yamltopy [-h] [-i INPUT] [-o OUTPUT] [-n NAME] [-v]
Convert YAML configuration file to a Python modulefor better performance
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
The input Yaml file (YML or YAML)
-o OUTPUT, --output OUTPUT
The output Py file
-n NAME, --name NAME The name of the exported variable containg the Yaml data
-v, --verbose
```
Convert YAML file to PY:
```shell
yamltopy -i path/to/file.yaml -o path/to/output.py -n NAME_OF_VARIABLE
```
You can import the output file (if modules set up properly):
```python
from path.to.output import NAME_OF_VARIABLE
print(NAME_OF_VARIABLE)
```