Giter VIP home page Giter VIP logo

jsonparse's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jsonparse's Issues

Document web api

The web api needs to be documented properly to create a new release

a group_by option

Provide a group_by parameter for the methods to return the found values as part of a two dimensional list. Each found value part of the same dict will be returned as a list. Multiple lists will be returned within a list.

The new find_keys() function currently returns a 2d list. The default behaviour should be changed to return a simple list, and return a 2d list if the group_by parameter is True. The parameter should have a default of False.

return on partial match

  • The idea behind this is to be able to return values based on a partial key match. e.g. find_key(data, 'myk') would match on the key mykey. This was prompted by the future cli mode of operation. This would allow piping a large chunk of json into the the cli app and matching on key guesses, in case you haven't fully manually scanned the large json data for the exact key to match beforehand.

add ability to use as a cli app

  • Include the feature to pipe data into the cli app, like typical *nix tools allow. This would allow for chaining of commands.
    curl my.api.with.highly.nested.json.response | jsonparse --find_key_chain ['my', 'key', 'chain']

  • Also, support the ability to provide a file of JSON as a flag.
    jsonparse --file my.json --find_key 'mykey'

match multiple(but not all) for find_key_chain

Currently find_key_chain() has the * operator to match all. Lets have an option to pass a list as an element to match multiple.

E.g. [ 'my', 'key', ['chain', 'rope'] ]
returns ['A', 5]

create end-to-end tutorial

  • Create a complete tutorial for newer users to python and libraries.
    e.g. requests public api -> json.loads() -> jsonparse

a find_value() method

It would return the parent set (like find_key_value) that contains the specified value.

Not sure why one would search based only on the value, but might be handy.

Flag to return single list

If the result is a single list, have a --single flag to return just the JSON type (e.g. a list), not a value in a list. Currently, all JSON types are added to a list, even if it's just one list for consistency. Avoids a [0] or a pop() for nested lists situations. Just avoids dealing with a list result of one item when you know for sure only one value is found. I think this would be a bit cleaner.

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.