PKG-INFO 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. Metadata-Version: 1.1
  2. Name: backports.csv
  3. Version: 1.0.5
  4. Summary: Backport of Python 3 csv module
  5. Home-page: https://github.com/ryanhiebert/backports.csv
  6. Author: Ryan Hiebert
  7. Author-email: ryan@ryanhiebert.com
  8. License: UNKNOWN
  9. Description: ================================================
  10. backports.csv: Backport of Python 3's csv module
  11. ================================================
  12. .. image:: https://img.shields.io/pypi/v/backports.csv.svg
  13. :target: https://pypi.python.org/pypi/backports.csv
  14. :alt: Latest Version
  15. .. image:: https://travis-ci.org/ryanhiebert/backports.csv.svg?branch=master
  16. :target: https://travis-ci.org/ryanhiebert/backports.csv
  17. .. image:: https://badges.gitter.im/ryanhiebert/backports.csv.svg
  18. :alt: Join the chat at https://gitter.im/ryanhiebert/backports.csv
  19. :target: https://gitter.im/ryanhiebert/backports.csv?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
  20. .. image:: https://requires.io/github/ryanhiebert/backports.csv/requirements.svg?branch=master
  21. :target: https://requires.io/github/ryanhiebert/backports.csv/requirements/?branch=master
  22. :alt: Requirements Status
  23. The API of the csv module in Python 2 is drastically different from
  24. the csv module in Python 3. This is due, for the most part, to the
  25. difference between str in Python 2 and Python 3.
  26. The semantics of Python 3's version are more useful because they support
  27. unicode natively, while Python 2's csv does not.
  28. Installation
  29. ============
  30. .. code-block:: sh
  31. pip install backports.csv
  32. Usage
  33. =====
  34. First make sure you're starting your file off right:
  35. .. code-block:: python
  36. from backports import csv
  37. Then be careful with your files to handle the encoding.
  38. If you're working with a binary file-like object,
  39. ``io.TextIOWrapper`` can be very helpful.
  40. If you're dealing with a file, you can just use ``io.open``
  41. instead of Python 2's ``open`` builtin, and it works
  42. just like Python 3's builtin ``open``.
  43. .. code-block:: python
  44. from backports import csv
  45. import io
  46. def read_csv(filename):
  47. with io.open(filename, newline='', encoding='utf-8') as f:
  48. for row in csv.reader(f):
  49. yield row
  50. def write_csv(filename, rows):
  51. with io.open(filename, 'w', newline='', encoding='utf-8') as f:
  52. writer = csv.writer(f)
  53. for row in rows:
  54. writer.writerow(row)
  55. Note: It should always be safe to specify ``newline=''``,
  56. since the csv module does its own (universal) newline handling.
  57. 1.0.5 (2017-05-29)
  58. ++++++++++++++++++
  59. * Fix bug in README example. (#22)
  60. - thanks to @tantale for the bug report
  61. * Allow ``None`` as quotechar when using ``QUOTE_NONE``. (#23)
  62. - thanks to @thanatos for the bug report
  63. 1.0.4 (2017-02-17)
  64. ++++++++++++++++++
  65. * Return write value from writerow. (#20)
  66. - thanks to @therg
  67. 1.0.3 (2017-01-23)
  68. ++++++++++++++++++
  69. * Add LICENSE file (#18).
  70. 1.0.2 (2016-09-15)
  71. ++++++++++++++++++
  72. * Avoid quoting any numeric types when using ``QUOTE_NONNUMERIC``.
  73. - thanks to @torfsen for the bug report
  74. 1.0.1 (2016-02-11)
  75. ++++++++++++++++++
  76. * Better error messages for invalid dialects.
  77. - thanks to @kengruven for the bug report
  78. 1.0 (2016-02-11)
  79. ++++++++++++++++
  80. * Initial Release
  81. Platform: UNKNOWN
  82. Classifier: Programming Language :: Python
  83. Classifier: Programming Language :: Python :: 2
  84. Classifier: Programming Language :: Python :: 2.6
  85. Classifier: Programming Language :: Python :: 2.7
  86. Classifier: Programming Language :: Python :: 3
  87. Classifier: Programming Language :: Python :: 3.3
  88. Classifier: Programming Language :: Python :: 3.4
  89. Classifier: Programming Language :: Python :: 3.5
  90. Classifier: Programming Language :: Python :: 3.6