|
-
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html><head><title>Python: module att.data</title>
- </head><body bgcolor="#f0f0f8">
-
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
- <tr bgcolor="#7799ee">
- <td valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="att.html"><font color="#ffffff">att</font></a>.data</strong></big></big></font></td
- ><td align=right valign=bottom
- ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C:/workbench/projects/att/att/data.py">c:\workbench\projects\att\att\data.py</a></font></td></tr></table>
- <p><tt><a href="#Data">Data</a> module for a Automatic Text Tools.<br>
- <br>
- (c) 2013 Ivan "Kai SD" Korystin <br>
- <br>
- License: GPLv3</tt></p>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#aa55cc">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
-
- <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
- <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="cStringIO.html">cStringIO</a><br>
- </td><td width="25%" valign=top><a href="codecs.html">codecs</a><br>
- </td><td width="25%" valign=top><a href="csv.html">csv</a><br>
- </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#ee77aa">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
-
- <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
- <td width="100%"><dl>
- <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
- </font></dt><dd>
- <dl>
- <dt><font face="helvetica, arial"><a href="att.data.html#Data">Data</a>
- </font></dt><dd>
- <dl>
- <dt><font face="helvetica, arial"><a href="att.data.html#CSVData">CSVData</a>
- </font></dt></dl>
- </dd>
- </dl>
- </dd>
- </dl>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#ffc8d8">
- <td colspan=3 valign=bottom> <br>
- <font color="#000000" face="helvetica, arial"><a name="CSVData">class <strong>CSVData</strong></a>(<a href="att.data.html#Data">Data</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt>Class for reading CSV files.<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%"><dl><dt>Method resolution order:</dt>
- <dd><a href="att.data.html#CSVData">CSVData</a></dd>
- <dd><a href="att.data.html#Data">Data</a></dd>
- <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
- </dl>
- <hr>
- Methods defined here:<br>
- <dl><dt><a name="CSVData-__init__"><strong>__init__</strong></a>(self, file, encoding<font color="#909090">='utf-8'</font>, delimiter<font color="#909090">=';'</font>, quotechar<font color="#909090">='"'</font>, **kwargs)</dt><dd><tt>Constructor.<br>
- <br>
- filename - CSV table filename<br>
- encoding - CSV table encoding (default: utf-8)<br>
- delimiter - CSV table delimiter (default: ;)<br>
- quotechar - CSV table quotechar (default: ")</tt></dd></dl>
-
- <dl><dt><a name="CSVData-export_csv"><strong>export_csv</strong></a>(self, filename, encoding<font color="#909090">='utf-8'</font>, delimiter<font color="#909090">=';'</font>, quotechar<font color="#909090">='"'</font>, **kwargs)</dt><dd><tt>Saves the data to CSV file<br>
- <br>
- filename - CSV table filename<br>
- encoding - CSV table encoding (default: utf-8)<br>
- delimiter - CSV table delimiter (default: ;)<br>
- quotechar - CSV table quotechar (default: ")</tt></dd></dl>
-
- <hr>
- Data and other attributes defined here:<br>
- <dl><dt><strong>Reader</strong> = <class att.data.Reader></dl>
-
- <dl><dt><strong>Writer</strong> = <class att.data.Writer></dl>
-
- <hr>
- Methods inherited from <a href="att.data.html#Data">Data</a>:<br>
- <dl><dt><a name="CSVData-__getitem__"><strong>__getitem__</strong></a>(self, pair)</dt><dd><tt>Returns a value for given key and row.</tt></dd></dl>
-
- <dl><dt><a name="CSVData-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
-
- <dl><dt><a name="CSVData-__setitem__"><strong>__setitem__</strong></a>(self, pair, value)</dt><dd><tt>Sets a value for given key and row.</tt></dd></dl>
-
- <dl><dt><a name="CSVData-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>Returns data as string.</tt></dd></dl>
-
- <dl><dt><a name="CSVData-add_data"><strong>add_data</strong></a>(self, other)</dt><dd><tt>Adds rows from another data table to this one.</tt></dd></dl>
-
- <dl><dt><a name="CSVData-add_keys"><strong>add_keys</strong></a>(self, *h)</dt><dd><tt>Adds new keys to the data.</tt></dd></dl>
-
- <dl><dt><a name="CSVData-add_rows"><strong>add_rows</strong></a>(self, n<font color="#909090">=1</font>)</dt><dd><tt>Adds some empty rows to the data.</tt></dd></dl>
-
- <dl><dt><a name="CSVData-col_by_idx"><strong>col_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns a column by header's index</tt></dd></dl>
-
- <dl><dt><a name="CSVData-col_by_key"><strong>col_by_key</strong></a>(self, key)</dt><dd><tt>Returns a column by header's name</tt></dd></dl>
-
- <dl><dt><a name="CSVData-del_row"><strong>del_row</strong></a>(self, idx)</dt><dd><tt>Removes giver row from data</tt></dd></dl>
-
- <dl><dt><a name="CSVData-has_key"><strong>has_key</strong></a>(self, key)</dt><dd><tt>Returns True if given key exists in data</tt></dd></dl>
-
- <dl><dt><a name="CSVData-row_by_idx"><strong>row_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns a row by index.</tt></dd></dl>
-
- <dl><dt><a name="CSVData-transpose"><strong>transpose</strong></a>(self, key_idx<font color="#909090">=0</font>)</dt><dd><tt>Returns the transposed copy of the data.<br>
- <br>
- key_idx - index of the column, that contains keywords (default: 0)</tt></dd></dl>
-
- <hr>
- Data descriptors inherited from <a href="att.data.html#Data">Data</a>:<br>
- <dl><dt><strong>__dict__</strong></dt>
- <dd><tt>dictionary for instance variables (if defined)</tt></dd>
- </dl>
- <dl><dt><strong>__weakref__</strong></dt>
- <dd><tt>list of weak references to the object (if defined)</tt></dd>
- </dl>
- </td></tr></table> <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#ffc8d8">
- <td colspan=3 valign=bottom> <br>
- <font color="#000000" face="helvetica, arial"><a name="Data">class <strong>Data</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt>Empty data class. Can be used for a subclassing or procedural data creation.<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="Data-__getitem__"><strong>__getitem__</strong></a>(self, pair)</dt><dd><tt>Returns a value for given key and row.</tt></dd></dl>
-
- <dl><dt><a name="Data-__init__"><strong>__init__</strong></a>(self, *args, **kwargs)</dt><dd><tt>Constructor</tt></dd></dl>
-
- <dl><dt><a name="Data-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
-
- <dl><dt><a name="Data-__setitem__"><strong>__setitem__</strong></a>(self, pair, value)</dt><dd><tt>Sets a value for given key and row.</tt></dd></dl>
-
- <dl><dt><a name="Data-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>Returns data as string.</tt></dd></dl>
-
- <dl><dt><a name="Data-add_data"><strong>add_data</strong></a>(self, other)</dt><dd><tt>Adds rows from another data table to this one.</tt></dd></dl>
-
- <dl><dt><a name="Data-add_keys"><strong>add_keys</strong></a>(self, *h)</dt><dd><tt>Adds new keys to the data.</tt></dd></dl>
-
- <dl><dt><a name="Data-add_rows"><strong>add_rows</strong></a>(self, n<font color="#909090">=1</font>)</dt><dd><tt>Adds some empty rows to the data.</tt></dd></dl>
-
- <dl><dt><a name="Data-col_by_idx"><strong>col_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns a column by header's index</tt></dd></dl>
-
- <dl><dt><a name="Data-col_by_key"><strong>col_by_key</strong></a>(self, key)</dt><dd><tt>Returns a column by header's name</tt></dd></dl>
-
- <dl><dt><a name="Data-del_row"><strong>del_row</strong></a>(self, idx)</dt><dd><tt>Removes giver row from data</tt></dd></dl>
-
- <dl><dt><a name="Data-has_key"><strong>has_key</strong></a>(self, key)</dt><dd><tt>Returns True if given key exists in data</tt></dd></dl>
-
- <dl><dt><a name="Data-row_by_idx"><strong>row_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns a row by index.</tt></dd></dl>
-
- <dl><dt><a name="Data-transpose"><strong>transpose</strong></a>(self, key_idx<font color="#909090">=0</font>)</dt><dd><tt>Returns the transposed copy of the data.<br>
- <br>
- key_idx - index of the column, that contains keywords (default: 0)</tt></dd></dl>
-
- <hr>
- Data descriptors defined here:<br>
- <dl><dt><strong>__dict__</strong></dt>
- <dd><tt>dictionary for instance variables (if defined)</tt></dd>
- </dl>
- <dl><dt><strong>__weakref__</strong></dt>
- <dd><tt>list of weak references to the object (if defined)</tt></dd>
- </dl>
- </td></tr></table></td></tr></table>
- </body></html>
|