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, column references by name (instead of named ranges), sticky headers (instead of freeze panes), stricter typing (instead of random types), and sort/filter dropdowns.

By default, Pandas provides read and write functionality for Excel, but it cannot create native Excel tables (the result is only formatted like one). This is where pandas-xlsx-tables comes in: it converts Excel tables to dataframes and vice versa while mostly preserving data types. The API has been kept deliberately simple 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 integrate 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 implementation. Additionally, the available extension points for different engines are limited. 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.1.2.tar.gz (32.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandas_xlsx_tables-1.1.2-py2.py3-none-any.whl (8.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pandas_xlsx_tables-1.1.2.tar.gz.

File metadata

  • Download URL: pandas_xlsx_tables-1.1.2.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for pandas_xlsx_tables-1.1.2.tar.gz
Algorithm Hash digest
SHA256 4555dc5d8c6265c7d07b51e3993a5f8e68336214ba72f32fef609bec786e39e1
MD5 666f7d1749a93e147887d78f8ff339d7
BLAKE2b-256 d965d933a680915ba4af1bc0415d5513c6da6a78c608ba3dc7fc647bb4668fc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pandas_xlsx_tables-1.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ef10fe80668041bc9846a43cb7009c01d39fed0312bb31caae2d43a20efa7101
MD5 c0a229577dcafaacb9ef3c9aeebafccd
BLAKE2b-256 397cf419202103f4d7e2dea3439dbdf15dc8c4eb583543968c3bfa06eff27f96

See more details on using hashes here.

Supported by

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