Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Convert Ruby output of older Hiera versions to equivalent Python or JSON data structures

Project description

# hipy

[![Travis CI Build Status](](
[![Coverage Status](](

Convert Ruby output of older Hiera versions to equivalent Python or JSON data structures.

## Usage

Usage: hipy [OPTIONS]

Convert Hiera output to JSON/Python

--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

$ echo nil | hipy
$ echo nil | hipy --json
$ echo nil | hipy --python
$ 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

>>> from hipy.parser import HieraOutputParser
>>> parser = HieraOutputParser(text='nil')

>>> parser.get_json()

>>> parser.get_python() is None

>>> parser = HieraOutputParser(text='nil', debug=True)
<Node called "nil" matching "nil">

## Tests

### tox

pip install tox

### manually

pip install -r test-requirements.txt
nosetests -c nose.cfg

## Installation

### PyPI

`pip install hipy`

### Locally

Run `python install`.

### [PEX](

virtualenv venv
source venv/bin/activate
pip install hipy pex

pex -r <(pip freeze) -c hipy -o hipy.pex

mv hipy.pex /tmp
cd /tmp
echo '{"a"=>6}' | ./hipy.pex --python
{u'a': 6}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hipy, version 0.12
Filename, size File type Python version Upload date Hashes
Filename, size hipy-0.12.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page