[CentralOH] Python and JSON (and more)

Eric Floehr eric at intellovations.com
Tue Mar 3 12:50:03 EST 2020


Thank you for this, it is awesome!!


On Tue, Mar 3, 2020 at 10:16 AM Greg Back <cohpy at gregback.net> wrote:

> Here are some notes I took from the January meeting (sorry this took so
> long to write up):
>
> Catherine shared about a tool she wrote to walk through arbitrarily deep
> data structures: https://github.com/catherinedevlin/imperial-walker .
> This can help (among other things) to examine new data sets to
> understand the shape of the data.
>
> Another very popular tool with a related purpose is jq
> (https://stedolan.github.io/jq/). One of Imperial-Walker's features
> emits jq expressions for each value in the data structure.
> A similar (golang) tool in the same space is gron:
> https://github.com/tomnomnom/gron
> jid (https://github.com/simeji/jid, also golang) is an interactive
> version of jq, also suitable for data exploration. jiq
> (https://github.com/fiatjaf/jiq) is an alternative to jid that uses jq
> under the hood.
>
> There are a few Python libraries that wrap jq (which is itself written
> in C):
> - https://github.com/doloopwhile/pyjq (most recent release in September
> 2019)
> - https://github.com/mwilliamson/jq.py (most recent release in February
> 2016)
> - https://www.drmaciver.com/2013/12/pyjq-a-work-in-progress/ (blog post,
> but the repository it points to appears to have been deleted)
> I don't personally have experience with these.
>
> We also had a good discussion about different data serialization formats
> (besides JSON). Here is an incredibly large table from Wikipedia:
> https://en.wikipedia.org/wiki/Comparison_of_data-serialization_formats
>
> Both YAML (https://yaml.org/) and TOML
> (https://github.com/toml-lang/toml) were discussed. Each has relatively
> decent support in Python (vi PyPI packages, not the standard library).
> There's an equivalent of jq for YAML (creatively named "yq":
> https://github.com/kislyuk/yq), which is a Python library that works by
> converting YAML to JSON behind the scenes and then invoking jq. While
> looking up things for this message, I found another tool named yq, which
> seems to be written in golang without depending on jq:
> https://github.com/mikefarah/yq
>
> If there's anything I missed, or other tools people know of which might
> be similarly helpful to the group, please share!
>
> Greg
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> https://mail.python.org/mailman/listinfo/centraloh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20200303/f87346bd/attachment.html>


More information about the CentralOH mailing list