Skip to main content
# hipy

[![Travis CI Build Status](https://travis-ci.org/marthjod/hipy.svg?branch=master)](https://travis-ci.org/marthjod/hipy)
[![Coverage Status](https://coveralls.io/repos/github/marthjod/hipy/badge.svg?branch=master)](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)

Source distribution for hipy 0.12
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

Release history Release notifications | RSS feed

This release

0.12 This release

1 release file

0.11

1 release file

0.10

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page