It 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).
Glom – Restructured Data for Python
11–20 of 99 posts
Re: Glom – Restructured Data for Python
#12This might have been unintentional, but I suspect "Spectre of Structure" and "Python's missing piece" refer to Nathan Marz's specter library for clojure [1], similarly touted as clojure's missing piece. I tend to agree in the case of specter, given the mind-boggling types of transformations that are easily (and simply) expressed in it (and often run faster than idiomatic clojure as well). Highly recommended if you ev…
Re: Glom – Restructured Data for Python
#13Striking a balance between ease of use / simplicity and powerful features is a tough exercise but you did well.
I can foresee the CLI being quite useful to do away with the run-of-the-mill sed / awk / grep [...] mess. Specifically for the less CLI inclined people out there.
Re: Glom – Restructured Data for Python
#14I have a need to transform between pairs of structures, in both directions, and ever since I found JsonGrammar (https://github.com/MedeaMelana/JsonGrammar2) I've been pining for a Python version.
Re: Glom – Restructured Data for Python
#15Can it be used bidirectionally, without having to repeat the work? I have a need to transform between pairs of structures, in both directions, and ever since I found JsonGrammar ( https://github.com/MedeaMelana/JsonGrammar2 ) I've been pining for a Python version.
Re: Glom – Restructured Data for Python
#16Can it be used bidirectionally, without having to repeat the work? I have a need to transform between pairs of structures, in both directions, and ever since I found JsonGrammar ( https://github.com/MedeaMelana/JsonGrammar2 ) I've been pining for a Python version.
It depends on the complexity of the spec, but we've already done some programmatic building of glomspecs, so for many cases I think the answer is yes! Once we feel out the patterns I think glom will gain some utilities for this purpose.
Re: Glom – Restructured Data for Python
#17Re: Glom – Restructured Data for Python
#18Can it be used bidirectionally, without having to repeat the work? I have a need to transform between pairs of structures, in both directions, and ever since I found JsonGrammar ( https://github.com/MedeaMelana/JsonGrammar2 ) I've been pining for a Python version.
Re: Glom – Restructured Data for Python
#19It would be great to have clarification if this is JSON only, or supports other data structures, or parsers could be plugged in?
Re: Glom – Restructured Data for Python
#20I'm probably being dense, but I don't see a good description of the input data types supported - the CLI says "json or python". It would be great to have clarification if this is JSON only, or supports other data structures, or parsers could be plugged in?
The CLI is in a pretty preliminary state, usable but not as robust as it will be in a few weeks. It only supports built-in parsers (JSON and Python literals) What formats are you thinking? YAML?