Skip to main content

Simple wrapper for openpyxl to create tables

Project description

from openpyxl import Workbook
wb = Workbook()



if isinstance(ws := wb.active, Worksheet):
    with DictWriter(ws, "A1", ['first_name', 'middle', 'last_name'], auto_header=True) as writer:
        writer.writerow({'first_name': 'Baked', 'middle': 'lfds', 'last_name': 'Beans'})
        writer.writerow({'first_name': 'Lovely', 'middle': 'lfds','last_name': 'Spam'})
        writer.writerow({'first_name': 'Wonderful', 'middle': 'lfds','last_name': 'Spam'})


    with DictWriter(ws, "K1", ['first_name', 'middle', 'last_name'], auto_header=False, displayName="Table2") as writer:
        writer.writerow({'first_name': 'First', 'middle': 'Middle', 'last_name': 'Last'})
        writer.writerow({'first_name': 'Baked', 'middle': 'lfds', 'last_name': 'Beans'})
        writer.writerow({'first_name': 'Lovely', 'middle': 'lfds','last_name': 'Spam'})
        writer.writerow({'first_name': 'Wonderful', 'middle': 'lfds','last_name': 'Spam'})


wb.save("test.xlsx")

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

openpyxl_table-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

openpyxl_table-0.1.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file openpyxl_table-0.1.2.tar.gz.

File metadata

  • Download URL: openpyxl_table-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.4

File hashes

Hashes for openpyxl_table-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f4528b786552c3074298264a8934b11f1fba4b082d64a62073e3552e1ed50d48
MD5 c2cfa8e3d2fe215b07cf98a15d03693c
BLAKE2b-256 3c52d232981bc2a2d489038454700348911b3d4032887713fcbc84e463c3f33e

See more details on using hashes here.

File details

Details for the file openpyxl_table-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for openpyxl_table-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76a2d0fb6a38968c2553abfcb0590793f4ae8d8b06b5bfb85dc3499ca6f7cc95
MD5 7228a67e9f9c56ba01f69d20b2305d73
BLAKE2b-256 685e668c5e18aafe24ad9eae12103b8c1de65d33c2e94e10200c303f021ffc76

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