Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

114 lignes
6.8KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html><head><title>Python: module data</title>
  3. </head><body bgcolor="#f0f0f8">
  4. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
  5. <tr bgcolor="#7799ee">
  6. <td valign=bottom>&nbsp;<br>
  7. <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>data</strong></big></big></font></td
  8. ><td align=right valign=bottom
  9. ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C:/users/kaisd/documents/workbench/programming/ktt/src/data.py">c:\users\kaisd\documents\workbench\programming\ktt\src\data.py</a></font></td></tr></table>
  10. <p><tt><a href="#Data">Data</a>&nbsp;module&nbsp;for&nbsp;a&nbsp;KaiSD&nbsp;Text&nbsp;Tools.<br>
  11. &nbsp;<br>
  12. (c)&nbsp;2013&nbsp;Ivan&nbsp;"Kai&nbsp;SD"&nbsp;Korystin&nbsp;<br>
  13. &nbsp;<br>
  14. License:&nbsp;GPLv3</tt></p>
  15. <p>
  16. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  17. <tr bgcolor="#aa55cc">
  18. <td colspan=3 valign=bottom>&nbsp;<br>
  19. <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
  20. <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  21. <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="codecs.html">codecs</a><br>
  22. </td><td width="25%" valign=top><a href="csv.html">csv</a><br>
  23. </td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
  24. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  25. <tr bgcolor="#ee77aa">
  26. <td colspan=3 valign=bottom>&nbsp;<br>
  27. <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
  28. <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  29. <td width="100%"><dl>
  30. <dt><font face="helvetica, arial"><a href="data.html#Data">Data</a>
  31. </font></dt><dd>
  32. <dl>
  33. <dt><font face="helvetica, arial"><a href="data.html#CSVData">CSVData</a>
  34. </font></dt></dl>
  35. </dd>
  36. </dl>
  37. <p>
  38. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  39. <tr bgcolor="#ffc8d8">
  40. <td colspan=3 valign=bottom>&nbsp;<br>
  41. <font color="#000000" face="helvetica, arial"><a name="CSVData">class <strong>CSVData</strong></a>(<a href="data.html#Data">Data</a>)</font></td></tr>
  42. <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
  43. <td colspan=2><tt>Class&nbsp;for&nbsp;reading&nbsp;CSV&nbsp;files.<br>&nbsp;</tt></td></tr>
  44. <tr><td>&nbsp;</td>
  45. <td width="100%">Methods defined here:<br>
  46. <dl><dt><a name="CSVData-__init__"><strong>__init__</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>Constructor.<br>
  47. &nbsp;<br>
  48. filename&nbsp;-&nbsp;CSV&nbsp;table&nbsp;filename<br>
  49. encoding&nbsp;-&nbsp;CSV&nbsp;table&nbsp;encoding<br>
  50. delimiter&nbsp;-&nbsp;CSV&nbsp;table&nbsp;delimiter<br>
  51. quotechar&nbsp;-&nbsp;CSV&nbsp;table&nbsp;quotechar<br>
  52. transpose=True&nbsp;-&nbsp;transpose&nbsp;the&nbsp;table</tt></dd></dl>
  53. <hr>
  54. Data and other attributes defined here:<br>
  55. <dl><dt><strong>Reader</strong> = &lt;class data.Reader&gt;</dl>
  56. <hr>
  57. Methods inherited from <a href="data.html#Data">Data</a>:<br>
  58. <dl><dt><a name="CSVData-__getitem__"><strong>__getitem__</strong></a>(self, pair)</dt><dd><tt>Returns&nbsp;a&nbsp;value&nbsp;for&nbsp;given&nbsp;key&nbsp;and&nbsp;row.</tt></dd></dl>
  59. <dl><dt><a name="CSVData-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
  60. <dl><dt><a name="CSVData-__setitem__"><strong>__setitem__</strong></a>(self, pair, value)</dt><dd><tt>Sets&nbsp;a&nbsp;value&nbsp;for&nbsp;given&nbsp;key&nbsp;and&nbsp;row.</tt></dd></dl>
  61. <dl><dt><a name="CSVData-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>Returns&nbsp;data&nbsp;as&nbsp;string.</tt></dd></dl>
  62. <dl><dt><a name="CSVData-add_keys"><strong>add_keys</strong></a>(self, *h)</dt><dd><tt>Adds&nbsp;new&nbsp;keys&nbsp;to&nbsp;the&nbsp;data.</tt></dd></dl>
  63. <dl><dt><a name="CSVData-add_rows"><strong>add_rows</strong></a>(self, n<font color="#909090">=1</font>)</dt><dd><tt>Adds&nbsp;some&nbsp;empty&nbsp;rows&nbsp;to&nbsp;the&nbsp;data.</tt></dd></dl>
  64. <dl><dt><a name="CSVData-col_by_key"><strong>col_by_key</strong></a>(self, key)</dt><dd><tt>Returns&nbsp;a&nbsp;column&nbsp;by&nbsp;header's&nbsp;name</tt></dd></dl>
  65. <dl><dt><a name="CSVData-has_key"><strong>has_key</strong></a>(self, key)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;given&nbsp;key&nbsp;exists&nbsp;in&nbsp;data</tt></dd></dl>
  66. <dl><dt><a name="CSVData-row_by_idx"><strong>row_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns&nbsp;a&nbsp;row&nbsp;by&nbsp;index.</tt></dd></dl>
  67. </td></tr></table> <p>
  68. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  69. <tr bgcolor="#ffc8d8">
  70. <td colspan=3 valign=bottom>&nbsp;<br>
  71. <font color="#000000" face="helvetica, arial"><a name="Data">class <strong>Data</strong></a></font></td></tr>
  72. <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
  73. <td colspan=2><tt>Empty&nbsp;data&nbsp;class.&nbsp;Can&nbsp;be&nbsp;used&nbsp;for&nbsp;a&nbsp;subclassing&nbsp;or&nbsp;procedural&nbsp;data&nbsp;creation.<br>&nbsp;</tt></td></tr>
  74. <tr><td>&nbsp;</td>
  75. <td width="100%">Methods defined here:<br>
  76. <dl><dt><a name="Data-__getitem__"><strong>__getitem__</strong></a>(self, pair)</dt><dd><tt>Returns&nbsp;a&nbsp;value&nbsp;for&nbsp;given&nbsp;key&nbsp;and&nbsp;row.</tt></dd></dl>
  77. <dl><dt><a name="Data-__init__"><strong>__init__</strong></a>(self, *args, **kwargs)</dt><dd><tt>Constructor</tt></dd></dl>
  78. <dl><dt><a name="Data-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
  79. <dl><dt><a name="Data-__setitem__"><strong>__setitem__</strong></a>(self, pair, value)</dt><dd><tt>Sets&nbsp;a&nbsp;value&nbsp;for&nbsp;given&nbsp;key&nbsp;and&nbsp;row.</tt></dd></dl>
  80. <dl><dt><a name="Data-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>Returns&nbsp;data&nbsp;as&nbsp;string.</tt></dd></dl>
  81. <dl><dt><a name="Data-add_keys"><strong>add_keys</strong></a>(self, *h)</dt><dd><tt>Adds&nbsp;new&nbsp;keys&nbsp;to&nbsp;the&nbsp;data.</tt></dd></dl>
  82. <dl><dt><a name="Data-add_rows"><strong>add_rows</strong></a>(self, n<font color="#909090">=1</font>)</dt><dd><tt>Adds&nbsp;some&nbsp;empty&nbsp;rows&nbsp;to&nbsp;the&nbsp;data.</tt></dd></dl>
  83. <dl><dt><a name="Data-col_by_key"><strong>col_by_key</strong></a>(self, key)</dt><dd><tt>Returns&nbsp;a&nbsp;column&nbsp;by&nbsp;header's&nbsp;name</tt></dd></dl>
  84. <dl><dt><a name="Data-has_key"><strong>has_key</strong></a>(self, key)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;given&nbsp;key&nbsp;exists&nbsp;in&nbsp;data</tt></dd></dl>
  85. <dl><dt><a name="Data-row_by_idx"><strong>row_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns&nbsp;a&nbsp;row&nbsp;by&nbsp;index.</tt></dd></dl>
  86. </td></tr></table></td></tr></table>
  87. </body></html>