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.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: openpyxl_table-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 1911f48d7983fa3f10fe456b093a33d44563ed584e897baa0967dfb618f1a8b4
MD5 4dc1afbd3d25088fba472c14846e8ec3
BLAKE2b-256 c2156338aab4a610d08040ca5ec36af448e12c1712c3e4c4509644dc789415bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openpyxl_table-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c89498dc3c6ab424570ff2c463b9b47b97d6ef69424cccbc7c0f22a032a3281e
MD5 22e6505990a742ce86a6e3a7d6b0de68
BLAKE2b-256 542c2a1cb89db140481f3f67b06dfb2ca8c799a3918b923c16a0b15c7ad3820e

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