summaryrefslogtreecommitdiff
path: root/tablib/core.py
diff options
context:
space:
mode:
authorMark Walling <mark@markwalling.org>2011-06-30 22:38:57 -0400
committerMark Walling <mark@markwalling.org>2011-06-30 22:38:57 -0400
commit864f29cc4b833fc3ac8cdeaa695d5894901d35b5 (patch)
treed6837bdde989c19f8192e5ff24cec9010951774c /tablib/core.py
parentd254c2d2b02b026d08cef01475d16fcc51e763ec (diff)
downloadtablib-864f29cc4b833fc3ac8cdeaa695d5894901d35b5.tar.gz
Updated some docstrings in core.py
* Binary warning for CSV output, because if you don't, Excel gets upset when Python translates \r\n to \r\n\r\n * Cleaned up what looked like a couple of copy paste errors
Diffstat (limited to 'tablib/core.py')
-rw-r--r--tablib/core.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tablib/core.py b/tablib/core.py
index 53f3767..1025b61 100644
--- a/tablib/core.py
+++ b/tablib/core.py
@@ -433,7 +433,7 @@ class Dataset(object):
.. admonition:: Binary Warning
- :class:`Dataset.xlsx` contains binary data, so make sure to write in binary mode::
+ :class:`Dataset.ods` contains binary data, so make sure to write in binary mode::
with open('output.ods', 'wb') as f:
f.write(data.ods)'
@@ -452,6 +452,17 @@ class Dataset(object):
data.csv = 'age, first_name, last_name\\n90, John, Adams'
Import assumes (for now) that headers exist.
+
+ .. admonition:: Binary Warning
+
+ :class:`Dataset.csv` uses \\r\\n line endings by default, so make
+ sure to write in binary mode::
+
+ with open('output.csv', 'wb') as f:
+ f.write(data.csv)'
+
+ If you do not do this, and you export the file on Windows, your
+ CSV file will open in Excel with a blank line between each row.
"""
pass
@@ -477,7 +488,7 @@ class Dataset(object):
set, a YAML list of objects will be returned. If no headers have
been set, a YAML list of lists (rows) will be returned instead.
- A dataset object can also be imported by setting the :class:`Dataset.json` attribute: ::
+ A dataset object can also be imported by setting the :class:`Dataset.yaml` attribute: ::
data = tablib.Dataset()
data.yaml = '- {age: 90, first_name: John, last_name: Adams}'