Load structured data (XML, JSON, CSV, TXT) from files or network (HTTP, HTTPS)

@cwilms-loyalist, it’s scheduled for Vuo 1.2.6.

@useful_design, it’s been a while since we’ve done an alpha/beta release, but they are on https://vuo.org/releases .

1 Like

Somehow I missed your response but am SO glad to hear it’s coming in Vuo 1.2.6… if you need any alpha/beta testers I can do a little testing with my planned project. :)

My initial need will just be to have my project read a datamatrix code with a camera, extract a 4-digit code from the delineated text string and then use that 4-digit code to find the appropriate replacement text in an XML file for displaying on screen.

@cwilms-loyalist and anyone else who’d like to be testers — we just published a Vuo 1.2.6 alpha release that includes XML/JSON nodes. We’d appreciate if you could try them out and let us know if they do what you need them to do.

The final 1.2.6 release will include much more stuff, including CSV nodes, but we wanted to get your feedback on the XML/JSON nodes sooner.

If you find any problems with the alpha release, please post a bug report. If you have questions/suggestions about the scope of this feature request (what the new nodes will/won’t be able to do), please comment here. For other questions/suggestions, probably best to a new discussion thread so it’s easier to follow the conversation.

3 Likes

Great!!! I’ll try it out as soon as I can! I’ll try and set some time aside tomorrow to do that. I’m away next week so I’ll really try and squeeze it in. This is amazing!

1 Like

I’ll have some time over the next week (after election campaigning on Climate action) to check it out. I have a few interesting datasets I’ve been wanting to get into Vuo. I tend to use CSV out of spreadsheets but it’s easy enough to use GREP to XMLify them.

I’m having a level beginner question about XML trees. I’m trying to get the Artist Name, Song Title and File Location for the iTunes songs from the iTunes Library XML.

I’m able to somehow locate the subtree of a song, but then I can’t find how to locate the Name or Title because they all start with subtree “Key” as name, then have “Name” or 'Title" as content, but the title or name itself is yet another subtree with name “String”, all the same again on the same line.

Should I be using Split Text from here on ? Can’t I do this because the way the XML is written or because of the node not considering the same line as a subcontent ? Thanks

Joining the composition, it assumes your iTunes Library is in -/Music/

iTunes Library XML Tree.vuo (3.57 KB)

I may be misunderstanding how to use the Find Subtrees using XPath node. I’ve created an expression that I thought would allow me to find value code and it’s sibling values fullname and school but it isn’t working like I thought it would.

The way I want it to work is to search by the program code and return with the fullname and school values that are it’s siblings.

XML Test.zip (3.81 KB)

@cwilms-loyalist, you need quotes around part of the XPath expression — replace /diplomas/program[code=scan] with /diplomas/program[code='scan'].

1 Like

@Bodysoulspirit, the iTunes music library is in a special (Apple-specific) XML format called a property list — which is convenient for some purposes, but unfortunately not for locating items in the XML.

Possibly we could enable the Make Tree from XML node to detect if the XML is a property list, and if so, turn the keys into element names and the values into content.

Anyone else interested in using the iTunes file or other property lists in Vuo?

@Bodysoulspirit, the iTunes music library is in a special (Apple-specific) XML format called a property list

Thanks for the info about that !

Possibly we could enable the Make Tree from XML node to detect if the XML is a property list, and if so, turn the keys into element names and the values into content.

Ok so either like that or as a specific Make Tree from Apple Property Lists node perhaps ? Would perhaps keep the regular node faster if less code ?

Well ok if this is so specific to Apple I could imagine a new feature request though if it is more work !

Anyone else interested in using the iTunes file or other property lists in Vuo ?

So you mean all other .plist OSX files would work as well ?

Somehow related interest from @vascoarmartins : Read iTunes playlists Feature Request  

1 Like

So you mean all other .plist OSX files would work as well ?

Good question — I meant that Make Tree from XML would handle property lists stored as XML text, like the iTunes file. But usually macOS stores property lists in a binary format (if you try to open the file in a text editor, it’s just a bunch of weird characters), so that would be a separate node, beyond the scope of this feature request.

Thanks for pointing out the existing feature request for reading iTunes playlists.

Good question — I meant that Make Tree from XML would handle property lists stored as XML text, like the iTunes file. But usually macOS stores property lists in a binary format.

Ok yeah as you said, I travelled the computer a bit and the iTunes library pretty much seems like the only xml property list, its icon also says XML where most other say PLIST. The funny thing is when you open all those PLISTS with Text Edit you get a binary like thing, but with a spacebar hit you actually see all those plist structured as XML even with the XML name at the top of it so that disturbed me ;)

But yeah if the iTunes library is the only XML Plist I would personally NOT put a constant extra port on the Make XML Tree node for that case only would you ? Don’t know.

I was actually just testing the XML tree with the library but I personally have most of my music in Spotify so that would require DB which is another Feature Request anyway.

So perhaps either more have a separate “Make Tree from Plist XML” node which the user could use to build up some iTunes library like database for vuo, or a “Make Tree from Plists” as a separate Feature Request, or wait for that “Read iTunes playlists Feature Request” by @vascoarmartins to be implemented.

Actually why I played with the iTunes database was because I wanted to retrieve the Name And Title from the songs which does not come up with the “Get Audio File Info”. That could be added there, as a feature request to get ID tags, but I’ve read iTunes has a special ID behavior though and more plays with it’s iTunes library so there would always be people to want ID tags and others to be able to read the iTunes library.

Not sure how much people in the community use iTunes tough ;)

@Chris, you need quotes around part of the XPath expression — replace /diplomas/program[code=scan] with /diplomas/program[code=‘scan’].

Thanks Jamie! This worked, looks like it’s going to do what I need it to do. Fantastic work!  

1 Like

OK, Jaymie… the first XML was working the way I expected however I was using the output of the first XML as an input for searching the second XML and ran into a stange issue where it’s returning an empty list. I can’t figure out why… it looks right to me. I’ve gone over it about 30x and made changes to the naming I was using in the XML to simplify things and everything and I can’t figure it out. Any ideas what I am missing? It’s probably simple.
I’m really confused because after your suggestion above about using quotes I had no trouble getting the first XML to work and the second one is even more basic than the first.  

XML Test.zip (1.41 MB)

@cwilms-loyalist, one of your XPath expressions contains smartquotes, which our parser (currently) doesn’t recognize as quotes.

In (Loyalist )BackgroundGraphic.vuo, replace

/loyalist/school[name=‘input’]

with

/loyalist/school[name='input']  

Thank-you!!! I don’t know if I ever would have noticed that! It’s working now!

1 Like

We just released Vuo 1.2.6-alpha2, which includes Table nodes for CSV/TSV, plus fixes to issues people reported for the Tree nodes (thanks!).

Please let us know if you have questions or find any bugs!

Released in Vuo 1.2.6

1 Like

Cool !

Example composition for loading a CSV of data and scaling it all onto a graph which animates though different years of the data points. Option to make a spline or line graph.

https://community.vuo.org/t/-/5973