pytablereader is a python library to load structured table data from files/URL with various data format: CSV/HTML/JSON/Markdown/MediaWiki/MediaWiki/Excel.
Project description
pytablereader
Summary
pytablereader is a python library to load structured table data from files/URL with various data format: CSV/HTML/JSON/Markdown/MediaWiki/MediaWiki/Excel.
Feature
- Extract structured table data from various data format:
CSV file/text
Microsoft Excel TM file
HTML file/text
JSON file/text
Markdown file/text
MediaWiki file/text
- Supported data sources to read:
Files
URL
Examples
Load a CSV table
from __future__ import print_function
import pytablereader
# 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 = pytablereader.CsvTableFileLoader(file_path)
for table_data in loader.load():
print("\n".join([
"load from file",
"==============",
"{:s}".format(table_data.dumps()),
]))
# load from a csv text ---
loader = pytablereader.CsvTableTextLoader(csv_text)
for table_data in loader.load():
print("\n".join([
"load from text",
"==============",
"{:s}".format(table_data.dumps()),
]))
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.readthedocs.org/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.6.8.tar.gz.
File metadata
- Download URL: pytablereader-0.6.8.tar.gz
- Upload date:
- Size: 58.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7b04f0c7670a3121d4f4ff945d63855a49ef703817de9b2080b886c42bc9d1d
|
|
| MD5 |
6ba4b90260e473af3020ce6cdd024869
|
|
| BLAKE2b-256 |
3ad380240c4b56ec8b0bcccc7611603e7f45407db7f90afec5e44dca1938b0b1
|
File details
Details for the file pytablereader-0.6.8-py2.py3-none-any.whl.
File metadata
- Download URL: pytablereader-0.6.8-py2.py3-none-any.whl
- Upload date:
- Size: 43.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63629302f7507b50fab5799b8ca862d92bb9caaf61e92481842487c7d9377ada
|
|
| MD5 |
24aff8f3544165581b4dbd8b68270984
|
|
| BLAKE2b-256 |
83f00fdfb96c9fed8ce4ed6e752dfb990a97d68fc808f4a0c0a65bfc3f62e2ee
|