excel实验模块
Project description
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:返回的是异常提示
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
sky-excel-1.0.1.tar.gz
(8.0 kB
view details)
Built Distribution
sky_excel-1.0.1-py3-none-any.whl
(12.0 kB
view details)
File details
Details for the file sky-excel-1.0.1.tar.gz
.
File metadata
- Download URL: sky-excel-1.0.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c196b2cc60485c351310534c724d2c08bb451b881e807efe099141c93aa78b2 |
|
MD5 | 316e1f5fc81f7a092fc065a19bacc62d |
|
BLAKE2b-256 | f8f61b80b3b430bbe50bfff6a0fe56cdbbef5cc876690ca8935f52d991d30baf |
File details
Details for the file sky_excel-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: sky_excel-1.0.1-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd69727b5023ef83388e0358b63f6cf19b96c6b34c401cf1f5d4f135c09ed8e2 |
|
MD5 | 210664dfe3666e5e5657432a3bf6e54e |
|
BLAKE2b-256 | 1e0501451efca8c092111ac4c8f707f09c85e6904bb1ea7a84eddf9aaab081d3 |