glom not only supports more than string keys, it also supports assigning to non-dictionary objects. That's a part of the API we're working on right now, actually.
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
by hiccuphippo on Wednesday May 09, 2018 @09:48PM
(#17035863)
Check the updateIn, mergeIn, mergeDeepIn methods in immutable.js. Maybe even asMutable, asImmutable for mutation.
Re:Glom – Restructured Data for Python
by smittywerben on Sunday May 13, 2018 @05:47AM
(#17058123)
Perhaps assoc_in or update_in from the Toolz library fits this?
https://toolz.readthedocs.io/en/latest/api.html#toolz.dictto... https://toolz.readthedocs.io/en/latest/api.html#toolz.dictto...
Re:Glom – Restructured Data for Python
by doublereedkurt on Wednesday May 09, 2018 @02:40PM
(#17032587)
'string-key', T['string-key'], T[not-string-key] :-)
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 in Ruby, so I was wondering if there were other solutions out there.
Another question occurs to me - does glom only support string keys?
[0]: https://bugs.ruby-lang.org/issues/11747