Skip to main content

# TableReader

TableReader is an unified abstraction for handling xls, xlsx and CSV files in Python. It also reads csv tables as unicode on request.

If you are familiar with csv.DictReader from the standard library, think of TableReader as DictReader on steroids.

from tablereader import TableReader

reader = TableReader("some_input.xlsx", sheet="The Data")
for row in reader:
    print row['valuecolumn']

In case you have csv and need unicode support:

reader = TableReader("unicode_input.csv", force_type="unicodecsv")
for row in reader:
    print row['valuecolumn']

If you want to strip out leading and trailing spaces while reading rows, you can:

reader = TableReader("input_with_whitespaces.csv", strip_whitespaces=True)
for row in reader:
    print row['valuecolumn']

And if for some reason you have a file with wrong type by line-ending (commonly found when sharing xls), override auto-detection:

reader = TableReader("wrong_named.xls", force_type="xlsx")
for row in reader:
    print row['valuecolumn']

Sometimes headers are not in the first line. So specify some header row search text and the entire row will be used as column name and all rows after are returned:

from tablereader import OffsetTableReader

reader = OffsetTableReader("wrong_named.xls", "BEGIN_DATA")
for row in reader:
    print row['valuecolumn']

The library has been tested on CPython 2.6, 2.7 and 3.4 as well as PyPy 2.4.1.

Release files for tablereader 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tablereader 1.1.1
File Size Uploaded Provenance Actions
tablereader-1.1.1.tar.gz 11.5 kB Without provenance Details for tablereader-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tablereader 1.1.1
File Interpreter ABI Platform Actions
tablereader-1.1.1-py3-none-any.whl Python 3 none any Details for tablereader-1.1.1-py3-none-any.whl

Total release size: 22.3 kB

Release files / tablereader-1.1.1.tar.gz

Download URL tablereader-1.1.1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9872a2a05dd6741edbe170aca82016f9036599e5d510e5c5570749b940f7ee53
BLAKE2b-256 checksum
How to use checksums
eb2a8437dcc6f0d98071757fe270e293153a3efca6e3a96ba445f9684139ad39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.2

Release files / tablereader-1.1.1-py3-none-any.whl

Download URL tablereader-1.1.1-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c73c66654582e30e060df92ea40bf3d261175831283e887ad88b051abd59959c
BLAKE2b-256 checksum
How to use checksums
0e7989670551eb5466a0a19396601e58fbe27c812ff11ac499f07072aa7ec93d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.2

Security for tablereader 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page