Skip to main content

Read and write excel tables with pandas

Project description

pandas-xlsx-tables

Even though you might not like it, Excel isn't going anywhere. And Excel with tables is a lot better than without. Some highlights are: better performance, reference columns by name (vs defining named ranges), sticky headers (vs freeze panes), stricter typing (vs random types) and sort/filter dropdowns.

Out of the box Pandas provides to and from excel functionality, but it cannot write native excel tables (the result is only formatted like one). This is where pandas-xlsx-tables comes in: convert excel tables to dataframes and vice versa, whilest mostly preserving data types. The api has been kept deliberatly simple as to provide useful functionality out of the box.

"Excel screenshot

>>> from pandas_xlsx_tables import xlsx_table_to_df
>>> df = xlsx_table_to_df("my_file.xlsx", "Table1")
>>> df
     col1 col2
Row
0       1    a
1       2    b

And the reverse process:

>>> from pandas_xlsx_tables import df_to_xlsx_table
>>> df_to_xlsx_table(df, "my_table", header_orientation="diagonal", index=False)

"Excel screenshot

Why not integretate this in Pandas directly?

Due to the complexity of Pandas and the large number of users it is very difficult to significantly change the current excel implementeation. Also the abstractions available to plug different engines are not that helpful. Basically I tried and gave up (but of course I would prefer having this built into Pandas).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandas-xlsx-tables-1.0.0.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

pandas_xlsx_tables-1.0.0-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pandas-xlsx-tables-1.0.0.tar.gz.

File metadata

  • Download URL: pandas-xlsx-tables-1.0.0.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pandas-xlsx-tables-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d4df099625b5bdac11795fafca740035bb24a3e02b10f5f7c85971d0e522e8f9
MD5 872c897bdef787d1d6231cf558a9b8fe
BLAKE2b-256 243cd3c60a2291fa6499b49fa5c59b9f7f0c60f43810ea544ec2eaa2692f46c9

See more details on using hashes here.

File details

Details for the file pandas_xlsx_tables-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pandas_xlsx_tables-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pandas_xlsx_tables-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 675ad29c74258610c8c1cfae4582d515a08ad7a95d7091899c79ac28d5e4bd3d
MD5 166c2f40fae4fface07987fd02f7840b
BLAKE2b-256 f726bbe5bf993ef613c4c814219eaea33085e918c6e4f982dc50a9c9ac070ca8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page