# hipy
[](https://travis-ci.org/marthjod/hipy)
[](https://coveralls.io/github/marthjod/hipy?branch=master)
Convert Ruby output of older Hiera versions to equivalent Python or JSON data structures.
## Usage
```bash
Usage: hipy [OPTIONS]
Convert Hiera output to JSON/Python
Options:
--version Show the version and exit.
--json / --python Format output as JSON/Python (default: JSON)
--debug Show debug output (mainly from parser)
--help Show this message and exit.
```
## Examples
### Standalone CLI script
```bash
$ echo nil | hipy
null
$ echo nil | hipy --json
null
$ echo nil | hipy --python
None
$ echo nil | hipy --python --debug
In: nil
<Node called "nil" matching "nil">
Out: None
```
For more examples (and possible limitations), cf. the test examples.
### Library
```python
>>> from hipy.parser import HieraOutputParser
>>> parser = HieraOutputParser(text='nil')
>>> parser.get_json()
'null'
>>> parser.get_python() is None
True
>>> parser = HieraOutputParser(text='nil', debug=True)
<Node called "nil" matching "nil">
```
## Tests
### tox
```
pip install tox
tox
```
### manually
```
pip install -r test-requirements.txt
nosetests -c nose.cfg
```
## Installation
### PyPI
`pip install hipy`
### Locally
Run `python setup.py install`.
### [PEX](https://pex.readthedocs.io/)
```bash
virtualenv venv
source venv/bin/activate
pip install hipy pex
pex -r <(pip freeze) -c hipy -o hipy.pex
deactivate
mv hipy.pex /tmp
cd /tmp
echo '{"a"=>6}' | ./hipy.pex --python
{u'a': 6}
```
[](https://travis-ci.org/marthjod/hipy)
[](https://coveralls.io/github/marthjod/hipy?branch=master)
Convert Ruby output of older Hiera versions to equivalent Python or JSON data structures.
## Usage
```bash
Usage: hipy [OPTIONS]
Convert Hiera output to JSON/Python
Options:
--version Show the version and exit.
--json / --python Format output as JSON/Python (default: JSON)
--debug Show debug output (mainly from parser)
--help Show this message and exit.
```
## Examples
### Standalone CLI script
```bash
$ echo nil | hipy
null
$ echo nil | hipy --json
null
$ echo nil | hipy --python
None
$ echo nil | hipy --python --debug
In: nil
<Node called "nil" matching "nil">
Out: None
```
For more examples (and possible limitations), cf. the test examples.
### Library
```python
>>> from hipy.parser import HieraOutputParser
>>> parser = HieraOutputParser(text='nil')
>>> parser.get_json()
'null'
>>> parser.get_python() is None
True
>>> parser = HieraOutputParser(text='nil', debug=True)
<Node called "nil" matching "nil">
```
## Tests
### tox
```
pip install tox
tox
```
### manually
```
pip install -r test-requirements.txt
nosetests -c nose.cfg
```
## Installation
### PyPI
`pip install hipy`
### Locally
Run `python setup.py install`.
### [PEX](https://pex.readthedocs.io/)
```bash
virtualenv venv
source venv/bin/activate
pip install hipy pex
pex -r <(pip freeze) -c hipy -o hipy.pex
deactivate
mv hipy.pex /tmp
cd /tmp
echo '{"a"=>6}' | ./hipy.pex --python
{u'a': 6}
```
Metadata
Release files for hipy 0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hipy-0.12.tar.gz | 3.5 kB | Details |
Release files / hipy-0.12.tar.gz
| Download URL | hipy-0.12.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
331a23b166de1c4d5694593f6237e971e26b8d9115ee832bce1ac7ce85b7580f
|
|
BLAKE2b-256 checksum How to use checksums |
a9d9c3e2274016f6f6b605e29180f6e03a34490de3bf1b4e8e5b25f8cf5d4c1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |