Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Logo

PyPI PyPI - Python Version Read the Docs PyPI - Wheel GitHub last commit PyPI - Downloads

fuzzytable is a set of tools for extracting tabular data out of messy spreadsheets.

This library was developed to meet the needs of projects relying on spreadsheet data that has been handled by many people. Headers are often missing or mispelled. The data is incorrectly formatted. The table is on the wrong worksheet or you don't know the correct spreadsheet name. Etc...

fuzzytable allows you to quickly extract that data instead of arduously QC'ing the data ahead of time. After extraction, you can query the FuzzyTable attributes to e.g. determine which fields were found and how closely the desired header matches the actual header.

Installation

pip install fuzzytable

Example Usage

Here's a light-hearted demo. To read this messy file using, say, the csv module, we'd have to first:

  • Delete rows 1 and 2.
  • Delete columns A and B.
  • Rename the headers.
A B C D E
These are not the droids
you are looking for. He
can go c o l o r first name GivenName
about his Gold C 3PO
business . Blue R2 D2

Let's instead leverage the FuzzyTable class.

>>> from fuzzytable import FuzzyTable

>>> droids = FuzzyTable(
...     path='droids.csv',
...     fields=['first_name', 'last_name', 'color'],
...     approximate_match=True,
...     min_ratio=.3
... )

Now let's play with the data we've extracted.

>>> droids['color']
['Gold', 'Blue']

>>> for droid in droids.records:
...     print(f"{droid['first_name']}-{droid['last_name']} is {droid['color']}.")
C-3PO is Gold.
R2-D2 is Blue.

>>> droids.fields['first_name'].col_num
3

>>> droids.sheet.header_row
2

Links

Supported Formats

  • Excel (.xlsx, .xlsm, .xltx, .xltm)
  • csv (.csv)

Basically, anything that can be read by the openpyxl or csv modules.

Metadata

Release files for fuzzytable 0.12.2a0

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

Source distribution (sdist)

Source distribution for fuzzytable 0.12.2a0
File Size Uploaded Provenance Actions
fuzzytable-0.12.2a0.tar.gz 323.0 kB Without provenance Details for fuzzytable-0.12.2a0.tar.gz

Built distribution (wheel)

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

Total release size: 385.2 kB

Release files / fuzzytable-0.12.2a0.tar.gz

Download URL fuzzytable-0.12.2a0.tar.gz
Size 323.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4f2e04c60ea20a1ce5562bf1a986b4339a31c41867e710b18d4062a73a651525
BLAKE2b-256 checksum
How to use checksums
81f7e1202727978019c3a382a766a07ad5c38f5c49a6a9d94775e3c78b42039f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Release files / fuzzytable-0.12.2a0-py3-none-any.whl

Download URL fuzzytable-0.12.2a0-py3-none-any.whl
Size 62.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e9dd6d6657c625391cf0bb779caff5bed9de13f0f83fc07eb3a4420caa4c135
BLAKE2b-256 checksum
How to use checksums
523b94240177106a91a4900eebf00c8b33f1b6eb292ea8f4fc2071165e8fe8ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Security for fuzzytable 0.12.2a0

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