Metadata-Version: 1.2
Name: json_processor
Version: 0.0.6
Summary: JSON Processor - Convert one JSON to another
Home-page: https://github.com/huntflow/json-processor
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Download-URL: https://github.com/huntflow/json-processor/tarball/0.0.6
Description: JSON processor
        ==============
        
        .. image:: https://travis-ci.org/huntflow/json-processor.svg?branch=master
          :target: https://travis-ci.org/huntflow/json-processor
        .. image:: https://codecov.io/gh/huntflow/json-processor/branch/master/graph/badge.svg
          :target: https://codecov.io/gh/huntflow/json-processor
        
        
        Simply convert one JSON to another.
        
        * **Easy to use.** Create a simple JSON conversion schema and pass it to processor
        * **Rich.** It uses ``jsonpointer`` so you can create complex processors
        
        
        Example
        -------
        
        .. code-block:: python
        
            from json_processor import json_process
        
            schema = {
                "type": "object",
                "value": {
                    "simple_key": "Just a string",
                    "values": {
                        "type": "array",
                        "from": {
                            "type": "jsonpointer",
                            "value": "/data/items"
                        },
                        "value": {
                            "type": "object",
                            "value": {
                                "id": {
                                    "type": "jsonpointer",
                                    "value": "/$value/foreign",
                                    "cast": "integer"
                                },
                                "name": {
                                    "type": "jsonpointer",
                                    "value": "/$value/name"
                                }
                            }
                        }
                    }
                }
            }
        
            data = {
                "data": {
                    "items": [
                        {
                            "foreign": "100",
                            "name": "Item 1"
                        },
                        {
                            "foreign": "150",
                            "name": "Item 2"
                        }
                    ]
                }
            }
        
            print(json_process(schema, data))
        
            # Outputs:
            # {'simple_key': 'Just a string', 'values': [{'id': 100, 'name': 'Item 1'}, {'id': 150, 'name': 'Item 2'}]}
        
        
        Installation
        ------------
        
        From PyPi
        ~~~~~~~~~
        
        .. code-block:: bash
        
            pip install json_processor
        
        
        Command line tool
        -----------------
        
        After installation you can use ``json_process`` utility:
        
        .. code-block:: bash
        
            json_process <schema_file> <json_file>
        
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >= 2.7
