A python library to load structured table data from files/URL with various data format: CSV/Excel/HTML/JSON/LTSV/Markdown/TSV.
Project description
pytablereader
Summary
A python library to load structured table data from files/URL with various data format: CSV/Excel/HTML/JSON/LTSV/Markdown/TSV.
Features
- Extract structured tabular data from various data format:
CSV
Microsoft Excel TM
HTML
JSON
Markdown
MediaWiki
Tab separated values (TSV)
- Supported data sources to read:
Files on a local file system
Accessible URL
str instance
Examples
Load a CSV table
import pytablereader as ptr
import pytablewriter as ptw
# prepare data ---
file_path = "sample_data.csv"
csv_text = "\n".join([
'"attr_a","attr_b","attr_c"',
'1,4,"a"',
'2,2.1,"bb"',
'3,120.9,"ccc"',
])
with open(file_path, "w") as f:
f.write(csv_text)
# load from a csv file ---
loader = ptr.CsvTableFileLoader(file_path)
for table_data in loader.load():
print("\n".join([
"load from file",
"==============",
"{:s}".format(ptw.dump_tabledata(table_data)),
]))
# load from a csv text ---
loader = ptr.CsvTableTextLoader(csv_text)
for table_data in loader.load():
print("\n".join([
"load from text",
"==============",
"{:s}".format(ptw.dump_tabledata(table_data)),
]))
load from file
==============
.. table:: sample_data
====== ====== ======
attr_a attr_b attr_c
====== ====== ======
1 4.0 a
2 2.1 bb
3 120.9 ccc
====== ====== ======
load from text
==============
.. table:: csv2
====== ====== ======
attr_a attr_b attr_c
====== ====== ======
1 4.0 a
2 2.1 bb
3 120.9 ccc
====== ====== ======
For more information
More examples are available at http://pytablereader.rtfd.io/en/latest/pages/examples/index.html
Installation
pip install pytablereader
Dependencies
Python 2.7+ or 3.3+
Mandatory Python packages
DataPropery (Used to extract data types)
Optional Python packages
Optional packages (other than Python packages)
Test dependencies
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytablereader-0.8.9.tar.gz.
File metadata
- Download URL: pytablereader-0.8.9.tar.gz
- Upload date:
- Size: 58.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4c3aaa4af5eaef5c63db8252d2d102c44eab39b0630aa3764f7615e0c5925b5
|
|
| MD5 |
685fade887ecb300f44178e214ebd113
|
|
| BLAKE2b-256 |
438afc316a6e0ace1c867b4880a313c31758ec9bacb81524b610f65311467976
|
File details
Details for the file pytablereader-0.8.9-py2.py3-none-any.whl.
File metadata
- Download URL: pytablereader-0.8.9-py2.py3-none-any.whl
- Upload date:
- Size: 40.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc3c5fcabe869e7f3de6e6a622d87e42d8d97684d9cfbf9e64e30a08ad8b8e54
|
|
| MD5 |
99cc3c86e1c88bc67b79f4499b7e4507
|
|
| BLAKE2b-256 |
54232c8a6eb4903cf7a00e1795ecaa0c8230bf2505c742c3ee20bdfc74d8f632
|