summaryrefslogtreecommitdiff
path: root/docs/index.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/index.rst')
-rw-r--r--docs/index.rst15
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/index.rst b/docs/index.rst
index 18d100e..570e1e5 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -30,18 +30,25 @@ and seamless format import & export.
::
>>> data = tablib.Dataset(headers=['First Name', 'Last Name', 'Age'])
- >>> map(data.append, [('Kenneth', 'Reitz', 22), ('Bessie', 'Monke', 21)])
+ >>> for i in [('Kenneth', 'Reitz', 22), ('Bessie', 'Monke', 21)]:
+ ... data.append(i)
- >>> print data.json
+
+ >>> print(data.export('json'))
[{"Last Name": "Reitz", "First Name": "Kenneth", "Age": 22}, {"Last Name": "Monke", "First Name": "Bessie", "Age": 21}]
- >>> print data.yaml
+ >>> print(data.export('yaml'))
- {Age: 22, First Name: Kenneth, Last Name: Reitz}
- {Age: 21, First Name: Bessie, Last Name: Monke}
- >>> data.xlsx
+ >>> data.export('xlsx')
<redacted binary data>
+ >>> data.export('df')
+ First Name Last Name Age
+ 0 Kenneth Reitz 22
+ 1 Bessie Monke 21
+
Testimonials
------------