excel2x
转换 Config 配置工具 excel2x
Python3 库 excel2x。只需要用工具生成自己项目的配置文件,就可以按照配置文件导Excel表了。现在支持 lua、json 格式,后面后继续扩展 csv、xml 等格式。
支持生成数据格式 Schema,现在支持 Lua Schema、JSON Schema, 后面会支持 TypeScript interface、Java Class 和 C# Class。
安装
pip install excel2x
使用方式
查看帮助
python3 -m excel2x -h
# or
excel2x-cli -h
创建项目配置
python3 -m excel2x --config project_path/config.json --name project_name --create
# or
excel2x-cli --config project_path/config.json --name project_name --create
命令行转换 Excel
按 config.json 配置转换
python3 -m excel2x --config project_path/config.json
# or
excel2x-cli --config project_path/config.json
转换单个文件
excel2x-cli -i xxx/xxx.xlsx -o project_path/xxx.json -f json
在 Python 脚本中使用
#!/usr/bin/env python3
# -*- coding: utf-8 -*
from excel2x import convert_config
from excel2x import convert_one
if __name__ == "__main__":
# 项目配置路径
proj_config_path = "project_path/config.json"
convert_config(proj_config_path)
# 单个文件转换
convert_one("xxx/xxx.xlsx", "project_path/xxx.json", "json")
Metadata
Release files for excel2x 0.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 | |
|---|---|---|---|
| excel2x-0.0.6.tar.gz | 98.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| excel2x-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 114.8 kB
Release files / excel2x-0.0.6.tar.gz
| Download URL | excel2x-0.0.6.tar.gz |
|---|---|
| Size | 98.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8d89884751b5b19c55e4934b24657a103fb700872771c07d6526d96d49b702b
|
|
BLAKE2b-256 checksum How to use checksums |
603cd870c82d88892e4738772cb7c2312d62b27a2176236dae43c32c5653c3d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / excel2x-0.0.6-py3-none-any.whl
| Download URL | excel2x-0.0.6-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82e5349c6b3056fcf9840c379142adaaaedd9188f70ab7d0de3f2174030633cb
|
|
BLAKE2b-256 checksum How to use checksums |
7b0414fedf929fca4b6a167610c294311c47879ad0f5c78abf315e62397de385
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|