Glom – Restructured Data for Python
sedimental.org
Glom – Restructured Data for Python
1–10 of 99 posts
Re: Glom – Restructured Data for Python
#2Re: Glom – Restructured Data for Python
#3I haven't played with this yet, but it looks really handy. I deal with much more JSON on the command line than I'd like, so I think having both a single library and command line tool to reshape that data will make that much easier. I've used jq a few times, but when I want to move a little beyond what it does I usually end up writing a Python script. Hopefully this will make that transition smoother.
Re: Glom – Restructured Data for Python
#4Re: Glom – Restructured Data for Python
#5It looks quite similar in spirit to Clojure's Specter library ( https://github.com/nathanmarz/specter ), and even seems to have a nod to it (The Spectre of Structure).
Declarative data transformation generates a lot of comparisons (almost all of them great, though!).
Re: Glom – Restructured Data for Python
#6My interest stems from this issue[0] on the Ruby issue tracker to make a symmetrical method to Hash#dig (which does something similar to, but more limited than glom) called Hash#bury. The problem in the issue was that inserting a value at a given index in an array proved difficult and unnatural in Ruby, so I was wondering if there were other solutions out there.
Another question occurs to me - does glom only support string keys?
Re: Glom – Restructured Data for Python
#7This is really cool. Did you ever consider an API to do the reverse - to insert a value at a particular point in the data? My interest stems from this issue[0] on the Ruby issue tracker to make a symmetrical method to Hash#dig (which does something similar to, but more limited than glom) called Hash#bury. The problem in the issue was that inserting a value at a given index in an array proved difficult and unnatural i…
As for the data insertion, mutation may be in the future, but for now glom only transforms and returns new objects. Definitely something to think about though, bookmarked! :)
Re: Glom – Restructured Data for Python
#8This is really cool. Did you ever consider an API to do the reverse - to insert a value at a particular point in the data? My interest stems from this issue[0] on the Ruby issue tracker to make a symmetrical method to Hash#dig (which does something similar to, but more limited than glom) called Hash#bury. The problem in the issue was that inserting a value at a given index in an array proved difficult and unnatural i…