JsonData Package

datastructure
developers
package

#1

Hi all!

I just want to share with you the JsonData package, which I have been developing every now and then and I find very useful on my workflows.

JsonData is a set of custom nodes to handle data using json-like structures. There is more info on the GitHub Wiki, but in essence it is based on the use of Dictionaries and displaying them as json structures.

Besides the basic methods to create, get values or add/remove keys, the package also includes nodes like merge, filter by values of a given key or sort them by values.

There are also two key capabilities built in the objects:

  • JsonOptions to determine how to handle duplicated keys:
    • None: Default value, which throws an exception.
    • Update: Which updates the value for the already existing key.
    • Combine: Creates a JsonArray object and combines both values
  • ‎Easy creation of nested structures by providing keys concatenated by dots (nesting is true by default).

Finally, it also comes with utilities to parse, read and write from/to json, XML and CSV, which covers most of the key data sharing formats. In this example I used Read.FromXMLFile to parse and query a .dyn file for a particular python script, and run it from another file.

Hopefully you´ll find it as useful as I do. It might be a small contribution to the Dynamo community, but it is exactly the essence of Dynamo, any bit counts! Besides, it has been quite fun to develop :slight_smile:


Excel Data into Revit
#2

Awesome cheers


#3

This is an awesome share - I see tons of potential with this.

Also glad to hear it was fun. Sitting back and watching the use cases will hopefully provide even more enjoyment! :smile:

I’m off to test the limits and see what I can parse from my code blocks - perhaps every custom function built in my dyn library? :crossed_fingers:


#4

Hi @alvpickmans,

Dynamo developer here.

This is super powerful. Have you taken a look at the new Dictionary feature incoming for Dynamo 2.0? I think it might work pretty nicely with what you’ve done here. For example, in Dynamo 2.0, you can initialize a Dictionary just like JSON:

dict = { "foo" : [1,2, { "bar": Point.ByCoordinates() }] };

There is also a collection of nodes, such as Dictionary.ByKeysValues. We’ve considered adding additional nodes, like JSON.Parse, and JSON.Stringify - which would produce and consume Dictionary’s. Let me know what you think.


#5

Hi @pboyer ,

I did check the new dictionaries and is an awesome step! They are actually the reason I wanted to wrap up everything I have been doing over the past year with JsonData before it goes to the oblivion :slightly_smiling_face:

I think it would work well with dictionaries and I would love to contribute for Dynamo 2.0 if there’s still time before its release. Do you have a date scheduled?