From e4726cb85cfe9383e7d4012a68638ebb90c58b1e Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 27 Aug 2017 03:48:01 -0400 Subject: update docs Signed-off-by: Kenneth Reitz --- docs/index.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/index.rst b/docs/index.rst index 55e5679..4a0f3f0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -29,18 +29,23 @@ Tablib is an :ref:`MIT Licensed ` format-agnostic tabular dataset library, >>> data = tablib.Dataset(headers=['First Name', 'Last Name', 'Age']) >>> for i in [('Kenneth', 'Reitz', 22), ('Bessie', 'Monke', 21)]: ... data.append(i) - - >>> print data.json + + >>> print(data.json) [{"Last Name": "Reitz", "First Name": "Kenneth", "Age": 22}, {"Last Name": "Monke", "First Name": "Bessie", "Age": 21}] - >>> print data.yaml + >>> print(data.yaml) - {Age: 22, First Name: Kenneth, Last Name: Reitz} - {Age: 21, First Name: Bessie, Last Name: Monke} >>> data.xlsx + >>> data.df + First Name Last Name Age + 0 Kenneth Reitz 22 + 1 Bessie Monke 21 + Testimonials ------------ -- cgit v1.2.1 From 36fa7ef097895fb0338515246beffed1557b1510 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 27 Aug 2017 03:56:14 -0400 Subject: update docs Signed-off-by: Kenneth Reitz --- docs/intro.rst | 3 +-- docs/tutorial.rst | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/intro.rst b/docs/intro.rst index e3da4dc..6af436d 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -49,7 +49,7 @@ Tablib is released under terms of `The MIT License`_. Tablib License -------------- -Copyright 2016 Kenneth Reitz +Copyright 2017 Kenneth Reitz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -77,7 +77,6 @@ Pythons Supported At this time, the following Python platforms are officially supported: -* cPython 2.6 * cPython 2.7 * cPython 3.3 * cPython 3.4 diff --git a/docs/tutorial.rst b/docs/tutorial.rst index d552e21..1a092e9 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -139,6 +139,14 @@ Tablib's killer feature is the ability to export your :class:`Dataset` objects i +**Pandas DataFrame** :: + + >>> data.df + First Name Last Name Age + 0 Kenneth Reitz 22 + 1 Bessie Monke 21 + + ------------------------ Selecting Rows & Columns ------------------------ -- cgit v1.2.1 From ab6633549f2f2f331736f3f974483c0e39a451f2 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 28 Aug 2017 01:04:16 -0400 Subject: Update index.rst --- docs/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/index.rst b/docs/index.rst index 4a0f3f0..fb6db95 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -31,17 +31,17 @@ Tablib is an :ref:`MIT Licensed ` format-agnostic tabular dataset library, ... 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) - {Age: 22, First Name: Kenneth, Last Name: Reitz} - {Age: 21, First Name: Bessie, Last Name: Monke} - >>> data.xlsx + >>> data.export('xlsx') - >>> data.df + >>> data.export('df') First Name Last Name Age 0 Kenneth Reitz 22 1 Bessie Monke 21 -- cgit v1.2.1 From ec54918f4a7303eba65e7575be52befed9c205c7 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 28 Aug 2017 01:06:43 -0400 Subject: Update tutorial.rst --- docs/tutorial.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 1a092e9..23d2773 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -115,33 +115,33 @@ Tablib's killer feature is the ability to export your :class:`Dataset` objects i **Comma-Separated Values** :: - >>> data.csv + >>> data.export('csv') Last Name,First Name,Age Reitz,Kenneth,22 Monke,Bessie,20 **JavaScript Object Notation** :: - >>> data.json + >>> data.export('json') [{"Last Name": "Reitz", "First Name": "Kenneth", "Age": 22}, {"Last Name": "Monke", "First Name": "Bessie", "Age": 20}] **YAML Ain't Markup Language** :: - >>> data.yaml + >>> data.export('yaml') - {Age: 22, First Name: Kenneth, Last Name: Reitz} - {Age: 20, First Name: Bessie, Last Name: Monke} **Microsoft Excel** :: - >>> data.xls + >>> data.export('xls') **Pandas DataFrame** :: - >>> data.df + >>> data.export('df') First Name Last Name Age 0 Kenneth Reitz 22 1 Bessie Monke 21 @@ -224,7 +224,7 @@ Let's add a dynamic column to our :class:`Dataset` object. In this example, we h Let's have a look at our data. :: - >>> data.yaml + >>> data.export('yaml') - {Age: 22, First Name: Kenneth, Grade: 0.6, Last Name: Reitz} - {Age: 20, First Name: Bessie, Grade: 0.75, Last Name: Monke} @@ -254,7 +254,7 @@ For example, we can use the data available in the row to guess the gender of a s Adding this function to our dataset as a dynamic column would result in: :: - >>> data.yaml + >>> data.export('yaml') - {Age: 22, First Name: Kenneth, Gender: Male, Last Name: Reitz} - {Age: 20, First Name: Bessie, Gender: Female, Last Name: Monke} @@ -354,7 +354,7 @@ When, it's often useful to create a blank row containing information on the upco # Write spreadsheet to disk with open('grades.xls', 'wb') as f: - f.write(tests.xls) + f.write(tests.export('xls')) The resulting **tests.xls** will have the following layout: -- cgit v1.2.1 From 69edb9def37be7f38a4fed6d6bf10a618eaec8e3 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 28 Aug 2017 01:14:36 -0400 Subject: Update index.rst --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/index.rst b/docs/index.rst index fb6db95..90289e2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -34,7 +34,7 @@ Tablib is an :ref:`MIT Licensed ` format-agnostic tabular dataset library, >>> 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} -- cgit v1.2.1 From 4c300e65a50eef72b91fa1909c9f68679723955e Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 1 Sep 2017 15:42:51 -0400 Subject: update install instructions Signed-off-by: Kenneth Reitz --- docs/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/install.rst b/docs/install.rst index 365cca8..4dab923 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -16,7 +16,7 @@ Distribute & Pip Of course, the recommended way to install Tablib is with `pip `_:: - $ pip install tablib + $ pip install tablib[pandas] ------------------- -- cgit v1.2.1 From 4c5d0b1a457b55c943fbff888459ad224c8a5bcd Mon Sep 17 00:00:00 2001 From: DougHudgeon Date: Mon, 25 Jun 2018 14:25:50 +1000 Subject: Instructions for opening Excel workbook and reading the first sheet --- docs/tutorial.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs') diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 23d2773..1fe11ee 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -289,6 +289,14 @@ Now that we have extra meta-data on our rows, we can easily filter our :class:`D It's that simple. The original :class:`Dataset` is untouched. +Open an Excel Workbook and read first sheet +-------------------------------- + +To open an Excel 2007 and later workbook with a single sheet (or a workbook with multiple sheets but you just want the first sheet), use the following: + +data = tablib.Dataset() +data.xlsx = open('my_excel_file.xlsx', 'rb').read() +print(data) Excel Workbook With Multiple Sheets ------------------------------------ -- cgit v1.2.1 From 4f8949417e5126f8416b61d7feb6cd666bae4fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=22RooTer=22=20Urba=C5=84ski?= Date: Wed, 12 Sep 2018 21:15:20 +0200 Subject: ujson presence no longer breaks tablib (resolves #297) (#311) --- docs/install.rst | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'docs') diff --git a/docs/install.rst b/docs/install.rst index 4dab923..a236b87 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -40,16 +40,6 @@ To download the full source history from Git, see :ref:`Source Control `. .. _zipball: http://github.com/kennethreitz/tablib/zipball/master -.. _speed-extensions: -Speed Extensions ----------------- - -You can gain some speed improvement by optionally installing the ujson_ library. -Tablib will fallback to the standard `json` module if it doesn't find ``ujson``. - -.. _ujson: https://pypi.python.org/pypi/ujson - - .. _updates: Staying Updated --------------- -- cgit v1.2.1