gexcel
一个 excel 便捷读取插入工具,有如下三个模块
- ExcelReader:读取数据(自适应 xlsx、xls)
- ExcelWriter:保存数据(可能会存在丢失长度问题)
- ExcelWriterPerfect:保存数据(不会丢失)
安装
pip install gexcel
示例
ExcelReader
自适应 xlsx、xls
打开失败很大概率是文件自身的类型和后缀不符
from gexcel import ExcelReader
reader = ExcelReader('Result.xlsx')
for i in reader.read_lines(): # 可以输入 sheet 获取 sheet索引 来输出
print(i)
ExcelWriter
from gexcel import ExcelWriter
excel = ExcelWriter()
writer = excel.writer(sheetname='Sheet') # sheetname 可以不给
for i in range(10):
writer.write_line([i])
excel.save('Result.xlsx')
ExcelWriterPerfect
from gexcel import ExcelWriterPerfect
excel = ExcelWriterPerfect('Result.xlsx')
writer = excel.writer(sheetname='Sheet') # sheetname 可以不给
for i in range(10):
writer.write_line([i])
excel.save()
注意:
这里的 writer 是线程安全的,一个 writer 代表一个 sheet
Metadata
Release files for gexcel 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gexcel-1.0.6.tar.gz | 4.1 kB | Without provenance | Details for gexcel-1.0.6.tar.gz |
Release files / gexcel-1.0.6.tar.gz
| Download URL | gexcel-1.0.6.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e2bbb0660a702ce57af54679ddd05528a64fa15ba5882500b3c7508c8acbf43
|
|
BLAKE2b-256 checksum How to use checksums |
9043694999f369129cfac637dd9f533bf996239966d39f533442d47ccbeff4aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.2
|
Security for gexcel 1.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.