PKG-INFO 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. Metadata-Version: 1.1
  2. Name: backports.csv
  3. Version: 1.0.2
  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. The API of the csv module in Python 2 is drastically different from
  21. the csv module in Python 3. This is due, for the most part, to the
  22. difference between str in Python 2 and Python 3.
  23. The semantics of Python 3's version are more useful because they support
  24. unicode natively, while Python 2's csv does not.
  25. Installation
  26. ============
  27. .. code-block:: sh
  28. pip install backports.csv
  29. Usage
  30. =====
  31. First make sure you're starting your file off right:
  32. .. code-block:: python
  33. from backports import csv
  34. Then be careful with your files to handle the encoding.
  35. If you're working with a binary file-like object,
  36. ``io.TextIOWrapper`` can be very helpful.
  37. If you're dealing with a file, you can just use ``io.open``
  38. instead of Python 2's ``open`` builtin, and it works
  39. just like Python 3's builtin ``open``.
  40. .. code-block:: python
  41. from backports import csv
  42. import io
  43. def read_csv(filename):
  44. with io.open(filename, newline='', encoding='utf-8') as f:
  45. for row in csv.reader(f):
  46. yield row
  47. def write_csv(filename, rows):
  48. with io.open(filename, 'w', newline='', encoding='utf-8') as f:
  49. writer = csv.writer(f)
  50. for row in rows:
  51. writer.writerows(row)
  52. Note: It should always be safe to specify ``newline=''``,
  53. since the csv module does its own (universal) newline handling.
  54. License
  55. =======
  56. This is a port of the csv module in the Python 3 standard libary.
  57. Because of this, backports.csv follows the same license as Python,
  58. whatever that may be at any given point in time.
  59. 1.0.2 (2016-09-15)
  60. ++++++++++++++++++
  61. * Avoid quoting any numeric types when using ``QUOTE_NONNUMERIC``.
  62. _ thanks to @torfsen for the bug report
  63. 1.0.1 (2016-02-11)
  64. ++++++++++++++++++
  65. * Better error messages for invalid dialects.
  66. - thanks to @kengruven for the bug report
  67. 1.0 (2016-02-11)
  68. ++++++++++++++++
  69. * Initial Release
  70. Platform: UNKNOWN
  71. Classifier: Programming Language :: Python
  72. Classifier: Programming Language :: Python :: 2
  73. Classifier: Programming Language :: Python :: 2.6
  74. Classifier: Programming Language :: Python :: 2.7
  75. Classifier: Programming Language :: Python :: 3
  76. Classifier: Programming Language :: Python :: 3.3
  77. Classifier: Programming Language :: Python :: 3.4
  78. Classifier: Programming Language :: Python :: 3.5