SKY-EXCEL Module
excel工具模块
Part 1. Introduce
介绍
如果你不希望每一次需要把接口返回的字典数据导出成excel表格而去设计表头、合并单元格,而进行一次一次重复大量的编程活动。那么你可以尝试一下这个模块。sky-excel把表头设计与单元格设计耦合到一起,你只需要创建一个excel模板即可,然后进行配置对应输入的字段就可以实现,把接口的数据导出单元格。
这个模块仅仅做了一件事情,就是把你写好的表头版本抄写一般,把字典数据按照键值对匹配填充进去即可。
Part 2. API Document
API 接口文档
export_instance = ExcelExport(
input_dict=global_export_data,
excel_templet_path="./templet/templet.xlsx",
save_path="D:\\PySet/sky-excel/templet/"
)
参数介绍:
input_dict:输入的字典数据,格式是[{..},{..}......]
excel_templet_path:保存模板的路径,确保程序可以找到你的模板excel文件
excel_templet_title:当前仅仅可以导出一个sheet,不可以实现批量的导出。所以需要指定,默认值Sheet1
save_path:保存的文件路径,不传则返回文件流直接返回前端提供下载,注意返回时候需要修改响应头协议
导出方法:
data, err = export_instance.export()
data:返回文件地址,或者文件流。前提是没有异常的情况下,否则返回空。
err:返回的是异常提示
Metadata
Release files for xj-excel 1.0.2
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 |
|---|---|---|---|---|
| xj_excel-1.0.2.tar.gz | 8.1 kB | Without provenance | Details for xj_excel-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xj_excel-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for xj_excel-1.0.2-py3-none-any.whl |
Total release size: 39.9 kB
Release files / xj_excel-1.0.2.tar.gz
| Download URL | xj_excel-1.0.2.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f14bf2649fcd314720c87c5d84519dae70e712e65f1b0448d3948b76f7b27b97
|
|
BLAKE2b-256 checksum How to use checksums |
3792509193e50271bf50292406b65223f6d6ba2196302d1760cb10eca8ea1e41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.5
|
Release files / xj_excel-1.0.2-py3-none-any.whl
| Download URL | xj_excel-1.0.2-py3-none-any.whl |
|---|---|
| Size | 31.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1a8af1b95786c2aa605254dd45fa5a5288c76577178f2cec351ed49c3ef2c6d
|
|
BLAKE2b-256 checksum How to use checksums |
0f908b2a8e42095749b3ac72603dce7292e2d8e03c54774fe5ea190aa7e112e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.5
|
Security for xj-excel 1.0.2
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.