semvec/pypi-packages huggingface dataset:
hipy 0.12
Convert Ruby output of older Hiera versions to equivalent Python or JSON data structures
License: MIT

# 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}
```
Flask-GzipBomb 0.1.0
Gzip Bomb responses for Flask
License: MIT

Gzip Bomb responses for Flask.

This package provides an extension to flask.Response class,
**GzipBombResponse**, which can be used as a defensive measure for various
vuln scans, dictionary attacks etc. It creates a response containing a gzipped
data block filled with null characters with varying number of rounds (to
achieve minimal size of response's content).

Example:

    >>> from flask import Flask
    >>> from flask_gzipbomb import GzipBombResponse
    >>>
    >>> app = Flask(__name__)
    >>>
    >>> @app.route('/tiny-bomb')
    ... def gzipped():
    ...     return GzipBombResponse(size='1M')
    >>>
    >>> app.run()

    >>> import gzip
    >>> import requests
    >>>
    >>> r = requests.get('http://localhost:5000/tiny-bomb')
    >>> r.headers['content-encoding']
    'gzip,gzip'
    >>> len(r.content) # gzipped content length in bytes
    64
    >>> data = gzip.decompress(r.content)
    >>> data = gzip.decompress(data)
    >>> len(data) # decompressed content length in bytes
    1048576

GzipBombResponse accepts all arguments accepted by Response class with
additional *size* parameter, describing response content length in bytes
after decompression. Possible values:

    '1k', '10k', '100k', '1M', '10M', '100M', '1G', '10G'

with k, M and G denoting kilobyte, megabyte and gigabyte. Any other value
will result raise a KeyError. By default *size* is set to '10M', however
it is recommended to use '10G' for achieving desired effect.

**This package is for protection and educational purposes only. Using it
for any malicious purpose is strictly prohibited.**