Giter Site home page Giter Site logo

jparse's Introduction

jparse - A JSON-like Object Parsing Tool for Python

https://github.com/elisong/jparse/blob/master/jparse.png
Build Status PyPI PyPI - Python Version Coverage Status

This tool is created to make retrieving data from http response.json() or json library json.loads() easy. It helps to flatten, filter, select, update, and sort such objects, finally to_df (pandas.DataFrame format).

Simple Case

>>> from jparse import JParser
>>> jp = JParser()
>>> TEST_CASE1 = [{'A1': 1, 'A2': 2, 'A3': 3},
                  {'A1': [4, 5, 6], 'A2': 7, 'A3': 'x'}]
>>> print(jp.flatten(TEST_CASE1))
defaultdict(None, {'0_A1': 1,
                   '0_A2': 2,
                   '0_A3': 3,
                   '1_A1_0': 4,
                   '1_A1_1': 5,
                   '1_A1_2': 6,
                   '1_A2': 7,
                   '1_A3': 'x'})

Dependencies

Installation

pip install jparse

or

pip install git+https://github.com/elisong/jparse.git#egg=jparse

Document

Document here

Changelog

v0.1.8 - 2018-08-18

  • Change JParser.to_df by adding sort before to DataFrame

v0.1.7 - 2018-08-18

  • Remove collections.dafaultdict from japrse.py

v0.1.6 - 2018-08-18

  • Change pd.DataFrame() to pd.DataFrame.from_records() for JParser.to_df()
  • Change assert_frame_equal import for tests/test_to_df.py

v0.1.5 - 2018-08-18

  • Changed remove JParser.to_df() reset_index()

v0.1.4 - 2018-08-15

  • Changed license.

v0.1.3 - 2018-08-13

  • Added project.

jparse's People

Contributors

elisong avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.