Export Tor descriptors with Csv, Xml, Json: tor2csv, Tor2xml, tor2json
|Reported by:||naif||Owned by:||atagar|
This ticket to add to Stem a functionality to Stem (as set of small sample applications) that export the tor descriptors in various useful formats:
A similar attempt for csv has been done on https://github.com/mrlanrat/TorExport
A post to tor-dev mlist about it is at https://lists.torproject.org/pipermail/tor-dev/2012-June/003633.html
A chat discussion is at:
atagar: for example the TorExport tried to do that goal (by torservers) https://github.com/mrlanrat/TorExport but it's not working properly
naif: Hm, so you're thinking that the use case is 'write a python app to parse and do something with the descriptors (say, filter), then export the results to a csv'? I could see use in that, though how should we handle new descriptor additions? Add another positional field that might not be expected by callers?
atagar: SQL! After all, it works *soooo* nicely for every Tor Python program that uses it.
atagar: you made the right definition of what i mean
atagar: a set of python app that use stem to do conversion to csv, json, xml for content of tor descriptors
atagar: i mean, i am a sysadmin, not a coder, so for me having something that i can easily sed/awk and/or load with simple CSV library it's *extremely* useful
naif: Sounds good. I'd be happy to add a 'get_csv()' method to decriptor classes and have a little converter like TorExport. However, I'm still not sure what you would like to have happen when there are descriptor additions.
Add the new fields to the end of the csv or something else?
atagar: it make sense
atagar: tipically within CSV files the 1st line it's used to describe various fields
atagar: we may have as a convention that the 1st line always bring the description of the descriptor addition fields?
naif: Ahh, ok. Please file a ticket, it would be an easy task for one of the new people to pick up. If there's a specific pressing need for it then I could easily hack it out.