<div>Hello,</div><div><br></div><div>Megan and I have been working on the CSV export functionality that was being discussed a little over a week ago, and given the recent discussion, we would like to clarify the expected/desired implementation of this feature.</div>

<div><br></div><div>We have created an export.py module within /stem/descriptor, which contains a single method as of now that takes a descriptor object and two possible lists of fields.  These lists are to be specified as either the explicitly included attributes of the descriptor or the attributes to be excluded.  As we continue to work on this code, Megan and I were wondering if it wouldn't be better to accept a file object as well, in addition to accepting any number of descriptor objects (i.e. def csv_exp(..., *descriptors)).  Or are there other suggestions request concerning what sort of input such a method should take?</div>

<div><br></div><div>-Erik & Megan</div><br><div class="gmail_quote">On Fri, Jul 6, 2012 at 1:49 PM, Damian Johnson <span dir="ltr"><<a href="mailto:atagar@torproject.org" target="_blank">atagar@torproject.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">> So is export intended to be an instance method of descriptor, one that just dumps a single csv line of the instance attributes (maybe subject to some selection of those attributes)?  Or a static method that takes a collection?<br>


<br>
</div>Either would work fine. I was envisioning the former, though on<br>
reflection stem/descriptor/export.py module would probably be better<br>
since that localizes this functionality and allows for better<br>
expansion in the future (other formats such as json, or the inclusion<br>
of import functionality).<br>
<div class="im"><br>
> It seems like it might be awkward to have to hack stem itself to add a new export format (for example).  Is this a concern?<br>
<br>
</div>That depends on how useful users would find it to be. If researchers<br>
commonly want csv export functionality then we might as well support<br>
it. However, if it's a rarely desired feature then there's little<br>
reason to clutter our API. My understanding is that this feature is<br>
mostly for researchers and sysadmins, so as part of the target<br>
audience I'm happy to defer to you on how we handle this.<br>
<div class="im"><br>
> Do all the known use-cases make need both an interface to Tor Control and a descriptor utility library?<br>
<br>
</div>No, you're completely right. Stem's controller functionality utilizes<br>
its descriptor functionality but not vice versa. Another design that<br>
we could go with is to make several smaller libraries (descriptors,<br>
controller, response parsing, shared utilities, etc) if stem grows<br>
unwieldy. However, we're nowhere near that yet and keeping stem as a<br>
single library makes development, testing, installation and usage far<br>
easier.<br>
<br>
Stem is a library to make working with Tor easier for developers and<br>
researchers, with the current scope of the Tor control and dir specs.<br>
My plan is to complete that, release it to the community, then see<br>
based on feedback where we should go from there.<br>
</blockquote></div><br>