1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
Tabbed: format-agnostic tabular dataset library
===============================================
::
_____ ______ ______ _________
__ /_______ ____ /_ ___ /_ _____ ______ /
_ __/_ __ `/__ __ \__ __ \_ _ \_ __ /
/ /_ / /_/ / _ /_/ /_ /_/ // __// /_/ /
\__/ \__,_/ /_.___/ /_.___/ \___/ \__,_/
Tabbed 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:
- JSON
- YAML
- Excel
- CSV
At this time, Tabbed supports the **export** of it's powerful Dataset object instances into any of the above formats. Import is underway.
Please note that tabbed *purposefully* excludes XML support. It always will.
Features
--------
Populate fresh data files: ::
headers = ('first_name', 'last_name', 'gpa')
data = [
('John', 'Adams', 4.0),
('George', 'Washington', 2.6),
('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)
print data.headers
# >>> ('first_name', 'last_name', 'gpa')
Slice rows: ::
print data[0:1]
# >>> [('John', 'Adams', 4.0), ('George', 'Washington', 2.6)]
Slice columns by header: ::
print data['first_name']
# >>> ['John', 'George', 'Henry']
Manipulate rows by index: ::
del data[0]
print data[0:1]
# >>> [('George', 'Washington', 2.6), ('Henry', 'Ford', 2.3)]
Roadmap
-------
- Import datasets from CSV, JSON, YAML
- Auto-detect import format
- Plugin support
|