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.3.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file openpyxl_table-0.1.3.tar.gz
.
File metadata
- Download URL: openpyxl_table-0.1.3.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc43ead22c7e661c15818911251bb2280e6d697451ed49b0ecaee0cb87d5d5e9 |
|
MD5 | 13ca4d8135940f8ed9a3fed7bf1a2ad2 |
|
BLAKE2b-256 | a076ba6fd3b0ba0ee77727913979cb71d40557e5db58942739e9949d1b3b0db4 |
File details
Details for the file openpyxl_table-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: openpyxl_table-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c330e4e91606d72e0c16414b32bdbcfb6b899d4a33af85d4ef2daf774b6bb8d |
|
MD5 | dc1961eb5708ed7a771bb433729f0276 |
|
BLAKE2b-256 | 20c59e82e3319b97496bd617e633a0d0eeeb049d9e36061ed166aac9a8df9685 |