From 1a122f2a4d42caf02c840530285b2b39a8e7185c Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Sep 2010 13:12:21 -0400 Subject: [PATCH 1/9] gitignore --- .gitignore | 3 ++- HISTORY.rst | 6 ++++++ NOTICE | 0 tabbed | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) delete mode 100644 NOTICE diff --git a/.gitignore b/.gitignore index 897c9ee..91c9479 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # application builds build/* dist/* +MANIFEST # python skin .pyc @@ -13,4 +14,4 @@ profile # pycharm noise .idea .idea/* -hi + diff --git a/HISTORY.rst b/HISTORY.rst index 996624f..537f471 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,12 @@ History ======= +0.6.1 (2010-09-12) +------------------ + +* Packaging hotfixes + + 0.6.0 (2010-09-11) ------------------ diff --git a/NOTICE b/NOTICE deleted file mode 100644 index e69de29..0000000 diff --git a/tabbed b/tabbed index 11986a1..3905612 100755 --- a/tabbed +++ b/tabbed @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Tabbed +Tabbed Copyright (c) 2010 Kenneth Reitz. MIT License. """ From a5528d731e89e931b034b8f3080b1928b4f358c5 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Sep 2010 13:13:08 -0400 Subject: [PATCH 2/9] Updated verbage in AUTHORS. --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 713fcc5..722a130 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -GistAPI.py is written and maintained by Kenneth Reitz and +Tablib is written and maintained by Kenneth Reitz and various contributors: Development Lead From e9166b14fd4da5c68774d959ef390da6b6e4491b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Sep 2010 13:13:43 -0400 Subject: [PATCH 3/9] Cleaned up fabfile. --- fabfile.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/fabfile.py b/fabfile.py index d29811e..887bc25 100644 --- a/fabfile.py +++ b/fabfile.py @@ -5,23 +5,3 @@ def scrub(): """ Death to the bytecode! """ local("rm -fr dist build") local("find . -name \"*.pyc\" -exec rm '{}' ';'") - -def test(): - """ Test parsing! """ - local("rm output/*") - local("./strata.py --nsanity_files 'strata/tests/samples/nsanity' -d") - -def build(): - """ Build application""" - pass - -def init(): - """ Initialize Environment """ - # TODO: Possibly add Virtual Environment? - local("sudo pip install -r REQUIREMENTS") - -if __name__ == '__main__': - # TODO: Remove (for testing purposes) - # TODO: [Possibly] add doctests - test() - \ No newline at end of file From 41c4fcc59f18c882d0526d43356934b55df797d6 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Sep 2010 13:15:21 -0400 Subject: [PATCH 4/9] Added authors and others to manifest. --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 370ba3d..cb38c48 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include HISTORY.rst README.rst tabbed \ No newline at end of file +include HISTORY.rst README.rst tabbed LICENSE AUTHORS \ No newline at end of file From ca17c9f96543d0f287da45bc2bdbbcbb506912c9 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Sep 2010 13:15:38 -0400 Subject: [PATCH 5/9] Proper usage of MANIFEST. --- MANIFEST | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 MANIFEST diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index b1643fd..0000000 --- a/MANIFEST +++ /dev/null @@ -1,8 +0,0 @@ -HISTORY.rst -README.rst -setup.py -tabbed -tablib/__init__.py -tablib/cli.py -tablib/core.py -tablib/helpers.py From 4e98563483b2e9a701f25f8a6ac0c8d665bf5d54 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Sep 2010 13:16:05 -0400 Subject: [PATCH 6/9] Encodings are important. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3c895d1..fb44680 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- import os import sys @@ -32,7 +33,7 @@ setup( 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', # 'Programming Language :: Python :: 2.5', - # 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ), # entry_points={ From c24d2dd45d124319f6ae6ac8050c59ce064c0cec Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Sep 2010 13:17:21 -0400 Subject: [PATCH 7/9] Docstring updates. --- tabbed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabbed b/tabbed index 3905612..c30ec36 100755 --- a/tabbed +++ b/tabbed @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Tabbed +Tabbed -- CLI for Tablib Copyright (c) 2010 Kenneth Reitz. MIT License. """ From 3dff8f5b794ceaff6ab51be79f7425c0b8981f3a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Sep 2010 13:28:55 -0400 Subject: [PATCH 8/9] updated readme a bit --- README.rst | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 812a0a6..4e23f55 100644 --- a/README.rst +++ b/README.rst @@ -12,8 +12,6 @@ Tablib: format-agnostic tabular dataset library Tablib is a format-agnostic tabular dataset library, written in Python. -It is a full python module which doubles as a CLI application for quick -dataset conversions. Formats supported: @@ -72,12 +70,34 @@ Manipulate rows by index: :: del data[0] print data[0:1] # >>> [('George', 'Washington', 2.6), ('Henry', 'Ford', 2.3)] + +Installation +------------ + +To install tablib, simply: :: + + $ pip install tablib + +Or, if you absolutely must: :: + + $ easy_install tablib +Contribute +---------- + +If you'd like to , simply fork `the repository`_, commit your changes, and send a pull requests. Make sure you add yourself to AUTHORS_! + Roadmap ------- - Import datasets from CSV, JSON, YAML +- Release CLI Interface - Auto-detect import format -- Plugin support \ No newline at end of file +- Add possible other exports (SQL?) +- Possibly plugin-ify format architecture +- Plugin support + +.. _`the repository`: http://github.com/kennethreitz/tablib +.. _AUTHORS: http://github.com/kennethreitz/tablib/blob/master/AUTHORS \ No newline at end of file From f188e3dd8779a1c100b097ca44e9739e0d37fa6a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Sep 2010 13:48:48 -0400 Subject: [PATCH 9/9] Heavy readme update. --- README.rst | 76 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/README.rst b/README.rst index 4e23f55..222c8f2 100644 --- a/README.rst +++ b/README.rst @@ -13,20 +13,20 @@ Tablib: format-agnostic tabular dataset library Tablib is a format-agnostic tabular dataset library, written in Python. -Formats supported: +Output formats supported: +- Excel - JSON - YAML -- Excel - CSV At this time, Tablib supports the **export** of it's powerful Dataset object instances into any of the above formats. Import is underway. -Please note that tablib *purposefully* excludes XML support. It always will. +Note that tablib *purposefully* excludes XML support. It always will. -Features --------- +Usage +----- Populate fresh data files: :: @@ -34,43 +34,71 @@ Populate fresh data files: :: headers = ('first_name', 'last_name', 'gpa') data = [ - ('John', 'Adams', 4.0), - ('George', 'Washington', 2.6), + ('John', 'Adams', 90), + ('George', 'Washington', 67), ('Henry', 'Ford', 2.3) ] data = tablib.Dataset(*data, headers=headers) - # Establish file location and save - data.save('test.xls') - Intelligently add new rows: :: - data.append('Bob', 'Dylan', 3.2) + >>> data.append(('Henry', 'Ford', 83)) - print data.headers - # >>> ('first_name', 'last_name', 'gpa') - - Slice rows: :: - print data[0:1] - # >>> [('John', 'Adams', 4.0), ('George', 'Washington', 2.6)] + >>> print data[:2] + [('John', 'Adams', 90), ('George', 'Washington', 67)] Slice columns by header: :: - print data['first_name'] - # >>> ['John', 'George', 'Henry'] + >>> print data['first_name'] + ['John', 'George', 'Henry'] +Easily delete rows: :: -Manipulate rows by index: :: + >>> del data[1] - del data[0] - print data[0:1] - # >>> [('George', 'Washington', 2.6), ('Henry', 'Ford', 2.3)] +Drumroll please........... +JSON! :: + + >>> print data.json + [ + { + "last_name": "Adams", + "age": 90, + "first_name": "John" + }, + { + "last_name": "Ford", + "age": 83, + "first_name": "Henry" + } + ] + + +YAML! :: + + >>> print data.yaml + - {age: 90, first_name: John, last_name: Adams} + - {age: 83, first_name: Henry, last_name: Ford} + +CSV... :: + + >>> print data.csv + first_name,last_name,age + John,Adams,90 + Henry,Ford,83 + +EXCEL!! :: + + >>> open('people.xls').write(data.xls) + +It's that easy. + Installation ------------ @@ -87,7 +115,7 @@ Or, if you absolutely must: :: Contribute ---------- -If you'd like to , simply fork `the repository`_, commit your changes, and send a pull requests. Make sure you add yourself to AUTHORS_! +If you'd like to , simply fork `the repository`_, commit your changes, and send a pull requests. Make sure you add yourself to AUTHORS_. Roadmap