Skip to content

Commit 2a72d85

Browse files
author
Kenneth Reitz
committed
Basic project structure in place.
1 parent 6dc7bb1 commit 2a72d85

11 files changed

Lines changed: 444 additions & 0 deletions

File tree

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# application builds
2+
build/*
3+
dist/*
4+
MANIFEST
5+
6+
# python skin
7+
*.pyc
8+
*.pyo
9+
10+
# osx noise
11+
.DS_Store
12+
profile
13+
14+
# pycharm noise
15+
.idea
16+
.idea/*
17+
18+
# vi noise
19+
*.swp
20+
docs/_build/*

AUTHORS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Pyandoc is written and maintained by Kenneth Reitz and
2+
various contributors:
3+
4+
Development Lead
5+
````````````````
6+
7+
- Kenneth Reitz <[email protected]>
8+
9+
10+
Patches and Suggestions
11+
```````````````````````
12+
13+
- A lucky someone!

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2010 Kenneth Reitz.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include HISTORY.rst README.rst LICENSE AUTHORS

NOTICE

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
Tablib includes some vendorized python libraries: pyyaml, simplejson, and xlwt.
2+
3+
4+
5+
PyYAML License
6+
==============
7+
8+
Copyright (c) 2006 Kirill Simonov
9+
10+
Permission is hereby granted, free of charge, to any person obtaining a copy of
11+
this software and associated documentation files (the "Software"), to deal in
12+
the Software without restriction, including without limitation the rights to
13+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
14+
of the Software, and to permit persons to whom the Software is furnished to do
15+
so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included in all
18+
copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26+
SOFTWARE.
27+
28+
29+
30+
SimpleJSON License
31+
==================
32+
33+
Copyright (c) 2006 Bob Ippolito
34+
35+
Permission is hereby granted, free of charge, to any person obtaining a copy of
36+
this software and associated documentation files (the "Software"), to deal in
37+
the Software without restriction, including without limitation the rights to
38+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
39+
of the Software, and to permit persons to whom the Software is furnished to do
40+
so, subject to the following conditions:
41+
42+
The above copyright notice and this permission notice shall be included in all
43+
copies or substantial portions of the Software.
44+
45+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51+
SOFTWARE.
52+
53+
54+
55+
56+
XLWT License
57+
============
58+
59+
Portions copyright © 2007, Stephen John Machin, Lingfo Pty Ltd
60+
All rights reserved.
61+
62+
Redistribution and use in source and binary forms, with or without
63+
modification, are permitted provided that the following conditions are met:
64+
65+
1. Redistributions of source code must retain the above copyright notice,
66+
this list of conditions and the following disclaimer.
67+
68+
2. Redistributions in binary form must reproduce the above copyright notice,
69+
this list of conditions and the following disclaimer in the documentation
70+
and/or other materials provided with the distribution.
71+
72+
3. None of the names of Stephen John Machin, Lingfo Pty Ltd and any
73+
contributors may be used to endorse or promote products derived from this
74+
software without specific prior written permission.
75+
76+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
77+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
78+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
79+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
80+
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
81+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
82+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
83+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
84+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
85+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
86+
THE POSSIBILITY OF SUCH DAMAGE.
87+
"""
88+
89+
"""
90+
Copyright (C) 2005 Roman V. Kiseliov
91+
All rights reserved.
92+
93+
Redistribution and use in source and binary forms, with or without
94+
modification, are permitted provided that the following conditions
95+
are met:
96+
97+
1. Redistributions of source code must retain the above copyright
98+
notice, this list of conditions and the following disclaimer.
99+
100+
2. Redistributions in binary form must reproduce the above copyright
101+
notice, this list of conditions and the following disclaimer in
102+
the documentation and/or other materials provided with the
103+
distribution.
104+
105+
3. All advertising materials mentioning features or use of this
106+
software must display the following acknowledgment:
107+
"This product includes software developed by
108+
Roman V. Kiseliov <[email protected]>."
109+
110+
4. Redistributions of any form whatsoever must retain the following
111+
acknowledgment:
112+
"This product includes software developed by
113+
Roman V. Kiseliov <[email protected]>."
114+
115+
THIS SOFTWARE IS PROVIDED BY Roman V. Kiseliov ``AS IS'' AND ANY
116+
EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
117+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
118+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Roman V. Kiseliov OR
119+
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
120+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
121+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
122+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
123+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
124+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
125+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
126+
OF THE POSSIBILITY OF SUCH DAMAGE.
127+
128+
Roman V. Kiseliov
129+
Russia
130+
Kursk
131+
Libknecht St., 4
132+
133+
+7(0712)56-09-83
134+
135+
136+
Subject: pyExcelerator

README.rst

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
Tablib: format-agnostic tabular dataset library
2+
===============================================
3+
4+
::
5+
6+
_____ ______ ___________ ______
7+
__ /_______ ____ /_ ___ /___(_)___ /_
8+
_ __/_ __ `/__ __ \__ / __ / __ __ \
9+
/ /_ / /_/ / _ /_/ /_ / _ / _ /_/ /
10+
\__/ \__,_/ /_.___/ /_/ /_/ /_.___/
11+
12+
13+
14+
Tablib is a format-agnostic tabular dataset library, written in Python.
15+
16+
Output formats supported:
17+
18+
- Excel (Sets + Books)
19+
- JSON (Sets + Books)
20+
- YAML (Sets + Books)
21+
- CSV (Sets)
22+
23+
Import formats supported:
24+
25+
- JSON (Sets + Books)
26+
- YAML (Sets + Books)
27+
- CSV (Sets)
28+
29+
Note that tablib *purposefully* excludes XML support. It always will.
30+
31+
Overview
32+
--------
33+
34+
`tablib.Dataset()`
35+
A Dataset is a table of tabular data. It may or may not have a header row. They can be build and maniuplated as raw Python datatypes (Lists of tuples|dictonaries). Datasets can be imported from JSON, YAML, and CSV; they can be exported to Excel (XLS), JSON, YAML, and CSV.
36+
37+
`tablib.Databook()`
38+
A Databook is a set of Datasets. The most common form of a Databook is an Excel file with multiple spreadsheets. Databooks can be imported from JSON and YAML; they can be exported to Excel (XLS), JSON, and YAML.
39+
40+
Usage
41+
-----
42+
43+
44+
Populate fresh data files: ::
45+
46+
headers = ('first_name', 'last_name')
47+
48+
data = [
49+
('John', 'Adams'),
50+
('George', 'Washington')
51+
]
52+
53+
data = tablib.Dataset(*data, headers=headers)
54+
55+
56+
Intelligently add new rows: ::
57+
58+
>>> data.append(('Henry', 'Ford'))
59+
60+
Intelligently add new columns: ::
61+
62+
>>> data.append(col=('age', 90, 67, 83))
63+
64+
Slice rows: ::
65+
66+
>>> print data[:2]
67+
[('John', 'Adams', 90), ('George', 'Washington', 67)]
68+
69+
70+
Slice columns by header: ::
71+
72+
>>> print data['first_name']
73+
['John', 'George', 'Henry']
74+
75+
Easily delete rows: ::
76+
77+
>>> del data[1]
78+
79+
Exports
80+
-------
81+
82+
Drumroll please...........
83+
84+
JSON!
85+
+++++
86+
::
87+
88+
>>> print data.json
89+
[
90+
{
91+
"last_name": "Adams",
92+
"age": 90,
93+
"first_name": "John"
94+
},
95+
{
96+
"last_name": "Ford",
97+
"age": 83,
98+
"first_name": "Henry"
99+
}
100+
]
101+
102+
103+
YAML!
104+
+++++
105+
::
106+
107+
>>> print data.yaml
108+
- {age: 90, first_name: John, last_name: Adams}
109+
- {age: 83, first_name: Henry, last_name: Ford}
110+
111+
CSV...
112+
++++++
113+
::
114+
115+
>>> print data.csv
116+
first_name,last_name,age
117+
John,Adams,90
118+
Henry,Ford,83
119+
120+
EXCEL!
121+
++++++
122+
::
123+
124+
>>> open('people.xls', 'wb').write(data.xls)
125+
126+
It's that easy.
127+
128+
Imports!
129+
--------
130+
131+
JSON
132+
++++
133+
134+
::
135+
136+
>>> data.json = '[{"last_name": "Adams","age": 90,"first_name": "John"}]'
137+
>>> print data[0]
138+
('John', 'Adams', 90)
139+
140+
141+
YAML
142+
++++
143+
::
144+
145+
>>> data.yaml = '- {age: 90, first_name: John, last_name: Adams}'
146+
>>> print data[0]
147+
('John', 'Adams', 90)
148+
149+
CSV
150+
+++
151+
::
152+
153+
>>> data.csv = 'age, first_name, last_name\n90, John, Adams'
154+
>>> print data[0]
155+
('John', 'Adams', 90)
156+
157+
>>> print data.yaml
158+
- {age: 90, first_name: John, last_name: Adams}
159+
160+
161+
162+
Installation
163+
------------
164+
165+
To install tablib, simply: ::
166+
167+
$ pip install tablib
168+
169+
Or, if you absolutely must: ::
170+
171+
$ easy_install tablib
172+
173+
174+
Contribute
175+
----------
176+
177+
If you'd like to contribute, simply fork `the repository`_, commit your changes to the **develop** branch (or branch off of it), and send a pull request. Make sure you add yourself to AUTHORS_.
178+
179+
180+
Roadmap
181+
-------
182+
- Release CLI Interface
183+
- Auto-detect import format
184+
- Add possible other exports (SQL?)
185+
- Ability to assign types to rows (set, regex=, &c.)
186+
187+
.. _`the repository`: http://github.com/kennethreitz/tablib
188+
.. _AUTHORS: http://github.com/kennethreitz/tablib/blob/master/AUTHORS

TODO.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Get inital work implimented

0 commit comments

Comments
 (0)