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.1.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file openpyxl_table-0.1.1.tar.gz
.
File metadata
- Download URL: openpyxl_table-0.1.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee1620a30351b46d513dbfcf0b116d3122831a7d5c628d2480076bafdba8932f |
|
MD5 | 7dee1c57b0a85993c45af0cb032dc85c |
|
BLAKE2b-256 | b4e49a85e2bf4c41687bc6704531737bd3f10dce583d71caa468a1d271945306 |
File details
Details for the file openpyxl_table-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: openpyxl_table-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d5899db1723983b16e29b9acd20696ed295c7f823c8a8d4261ea051f4a6174f |
|
MD5 | 06247b4680b43b187d89f0f31c3a904c |
|
BLAKE2b-256 | f11a59d3f9289ce0cb82145194dd449f490fc7e0b89d9fc068471fe29d98f1fa |