Opened 8 years ago

Closed 8 years ago

#6171 closed enhancement (implemented)

Export Tor descriptors with Csv, Xml, Json: tor2csv, Tor2xml, tor2json

Reported by: naif Owned by: atagar
Priority: Medium Milestone:
Component: Archived/Stem Version:
Severity: Keywords: descriptors
Cc: atagar Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


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:

  • csv
  • xml
  • json

A similar attempt for csv has been done on

A post to tor-dev mlist about it is at

A chat discussion is at:

atagar: for example the TorExport tried to do that goal (by torservers) 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.

Child Tickets

Change History (4)

comment:1 Changed 8 years ago by runa

Cc: runa removed

comment:2 Changed 8 years ago by atagar

Shame on me for not updating this ticket. The Wesleyan students added csv exporting functionality to stem a while back...

With this we should have parity with the TorExport script that you mentioned, but not export capacity for the other formats. They wouldn't be hard to add but I'd rather hold off until we have someone who needs it for their project.

Leaving this ticket open for now but I'll resolve it eventually if there's no interest.

comment:3 Changed 8 years ago by atagar

Keywords: descriptors added

comment:4 Changed 8 years ago by atagar

Resolution: implemented
Status: newclosed

I'm gonna go ahead and resolve this. We can extend the exporter (and maybe add an importer) as demand arises.

Note: See TracTickets for help on using tickets.