Permalink
Browse files

README rst syntax

  • Loading branch information...
1 parent 491aa7a commit 047e970ccd6bc79827c759adc0c242e37847d0e0 @GMLudo GMLudo committed Sep 19, 2012
Showing with 25 additions and 19 deletions.
  1. +0 −18 README
  2. +24 −0 README.rst
  3. +1 −1 setup.py
View
18 README
@@ -1,18 +0,0 @@
-TL;DR: The unicodecsv is a drop-in replacement for Python 2's csv module which supports unicode strings without a hassle.
-
-More fully:
-
-Python 2's csv module doesn't easily deal with unicode strings, leading to the dreaded "'ascii' codec can't encode characters in position ..." exception.
-
-You can work around it by encoding everything just before calling write (or just after read), but why not add support to the serializer?
-
->>> import unicodecsv
->>> from cStringIO import StringIO
->>> f = StringIO()
->>> w = unicodecsv.writer(f, encoding='utf-8')
->>> w.writerow((u'é', u'ñ'))
->>> f.seek(0)
->>> r = unicodecsv.reader(f, encoding='utf-8')
->>> row = r.next()
->>> print row[0], row[1]
-é ñ
View
@@ -0,0 +1,24 @@
+unicodecsv
+==========
+
+The unicodecsv is a drop-in replacement for Python 2's csv module which supports unicode strings without a hassle.
+
+More fully
+----------
+
+Python 2's csv module doesn't easily deal with unicode strings, leading to the dreaded "'ascii' codec can't encode characters in position ..." exception.
+
+You can work around it by encoding everything just before calling write (or just after read), but why not add support to the serializer?
+
+::
+
+ >>> import unicodecsv
+ >>> from cStringIO import StringIO
+ >>> f = StringIO()
+ >>> w = unicodecsv.writer(f, encoding='utf-8')
+ >>> w.writerow((u'é', u'ñ'))
+ >>> f.seek(0)
+ >>> r = unicodecsv.reader(f, encoding='utf-8')
+ >>> row = r.next()
+ >>> print row[0], row[1]
+ é ñ
View
@@ -8,7 +8,7 @@
name='unicodecsv',
version=version,
description="Python2's stdlib csv module is nice, but it doesn't support unicode. This module is a drop-in replacement which *does*.",
- long_description=open('README', 'r').read(),
+ long_description=open('README.rst', 'r').read(),
author='Jeremy Dunck',
url='https://github.com/jdunck/python-unicodecsv',
packages=find_packages(),

0 comments on commit 047e970

Please sign in to comment.