All Projects → cupen → excel2xx

cupen / excel2xx

Licence: WTFPL License
导出 Excel 到结构化数据或代码 ( lua, c/c++, go 等等由你的 mako 模板决定 )

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
Mako
254 projects

Projects that are alternatives of or similar to excel2xx

xlsx-reader
xlsx-reader is a PHP library for fast and efficient reading of XLSX spreadsheet files. Its focus is on reading the data contained within XLSX files, disregarding all document styling beyond that which is strictly necessary for data type recognition. It is built to be usable for very big XLSX files in the magnitude of multiple GBs.
Stars: ✭ 40 (+185.71%)
Mutual labels:  excel, excelreader
abap2xlsx
Generate your professional Excel spreadsheet from ABAP
Stars: ✭ 493 (+3421.43%)
Mutual labels:  excel, excelreader
ExcelReads
ExcelReads(简单Excel通用读写器)
Stars: ✭ 46 (+228.57%)
Mutual labels:  excel, excelreader
gscloudplugin
浏览器打印PDF。 浏览器打印HTML。 浏览器打印图片。 浏览器打印Word。浏览器打印Excel。浏览器打印PPT。浏览器打印自定义绘图。浏览器打印微软报表。 使用静默方式打印。蓝牙打印。读写串口数据。读取电子秤重量
Stars: ✭ 18 (+28.57%)
Mutual labels:  excel
ExecutionMaster
Windows utility for intercepting process creation and assigning standard actions to program startup
Stars: ✭ 54 (+285.71%)
Mutual labels:  utility
powerlet
⚡️ Chrome Extension to quickly find and run bookmarklets
Stars: ✭ 17 (+21.43%)
Mutual labels:  utility
glitter
Display git status information in your shell prompt
Stars: ✭ 47 (+235.71%)
Mutual labels:  utility
oc-bootstrapper
Easily bootstrap a new October CMS project
Stars: ✭ 86 (+514.29%)
Mutual labels:  utility
utility-ai
A small Utility Ai Framework
Stars: ✭ 16 (+14.29%)
Mutual labels:  utility
Hytilities
Hypixel-focused Quality of Life mod.
Stars: ✭ 53 (+278.57%)
Mutual labels:  utility
Vincenty-Excel
Thaddeus Vincenty's Direct and Inverse formulae for geodesic calculations in Excel (distance, azimuth, latitude, longitude).
Stars: ✭ 29 (+107.14%)
Mutual labels:  excel
proxy-pants
Secured and reliable Proxy based utilities for more or less common tasks.
Stars: ✭ 36 (+157.14%)
Mutual labels:  utility
react-component-pack
Library that allows you to create context provider groups
Stars: ✭ 32 (+128.57%)
Mutual labels:  utility
awesome-canvas
Canvas资源库大全中文版。An awesome Canvas packages and resources.
Stars: ✭ 288 (+1957.14%)
Mutual labels:  excel
tiny-zip
The missing Zip library for Java
Stars: ✭ 18 (+28.57%)
Mutual labels:  utility
EPPlus4PHP
an easy-to-use excel library for php project which is compiled with peachpie. NOT FOR THE COMMON PHP PROJECT!
Stars: ✭ 15 (+7.14%)
Mutual labels:  excel
lpk
Find go projects/packages in your GOPATH
Stars: ✭ 13 (-7.14%)
Mutual labels:  utility
VBA-Arrays
😎 Array functions that are similar JavaScript functions. Example: Push, Pop, Shift, Unshift, Sort, length, toString.
Stars: ✭ 48 (+242.86%)
Mutual labels:  excel
vimclip
Never type outside vim again
Stars: ✭ 70 (+400%)
Mutual labels:  utility
multipurpose-bot
a multipurpose discord bot made with dbd.js
Stars: ✭ 32 (+128.57%)
Mutual labels:  utility

简介

导出 Excel 到各种结构化数据或代码。除命令行接口外也提供了 Python API 便于做二次加工。

繁介

你总会需要一些由非技术人员提供的数据来充实你的产品内容,比如美术资源和游戏数值。美术资源好说, 规范好目录和文件名就万事大吉了,但数值咋放呢?必须要有一个他懂、你懂、程序也懂的数值载体。 Excel 作为一款数据处理工具,做游戏数值简直易如反掌。于是本项目应运而生,用来搬运 Excel 数据。

p.s: 避免人工编辑 json, xml, 数据库之类的,那样太低效,很没人情味。

特性

  • 支持类型约束

    • 基本类型:
      string, int, float, bool
    • 数组类型:
      文法:array<类型>
      例子:array<int>, array<float>, array<bool> 等等
    • Map 类型:
      键值对数据, 就是 hash table
      文法:map<类型, 类型>
      例子:map<string, string>, map<string, int> 等等
    • Object 类型:
      用于自定义字段名和字段类型
      文法:Object<字段1:类型, 字段2:类型, ...> 字段名和类型可自由定义多个
      例子:Object<id:int, name> 表示将 {9527, “小明”} 导出为 {“id”:9527, "name":"小明"}
    • ItemExpr(物品表达式)
      一种易于读写的 DSL, 用于描述游戏中的资源数值。
      文法: 类型-ID-数量.
      例子: coin-100 表示 100 金币. weapon-1001-4 表示 4件ID为1001的武器。
    • Ratio 类型: 表示数字比例
      例子: 1:100
  • 支持多种数据结构 e.g. list,dict, (tree 还有待探索)。

  • 支持导出到 json, msgpack.

  • 支持导出到任意代码(需要使用 mako 模板脚本)。

运行依赖

  • Python3.6+

安装

$ pip install excel2xx

使用

Python API示例(推荐)

  • 读取 excel sheet
    from excel2xx import Excel
    excel = Excel("abc.xlsx")
    
    # 获取第一个 sheet
    sheet = excel[0]
    for row in sheet:
        print(row)
        
    # 根据 sheet 名获取
    sheet = excel["你好啊"]
    for row in sheet:
        print(row)
  • 自定义 ItemExpr(游戏资源类型)
    from excel2xx import Excel
    from excel2xx.fields import ItemExpr
    
    # 注册一个只包含 count 字段的资源类型
    ItemExpr.register("coin", ItemExpr.OnlyCount)
    
    # 注册自定义的资源类型
    def parse_youritem(v:str) -> dict:
        # parsing...
        return blahblah...
    ItemExpr.register("your item", parse_youritem)
    excel = Excel("abc.xlsx")
    ...

CLI 示例

$ excel2xx json example/test.xls    -o example/test.json
$ excel2xx msgpack example/test.xls -o example/test.msgpack
$ excel2xx mako example/test.xls    -o example/test.lua  --template example/test.lua.mako

TODO

  • 支持导出到任意编程语言代码(用 mako 模板引擎).
  • 支持自定义数据检错过程,用于杜绝过于低级的数值错误.

LICENSE

WTFPL
            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                    Version 2, December 2004

 Copyright (C) 2014-2021 cupen<[email protected]>

 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. You just DO WHAT THE FUCK YOU WANT TO.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].