GithubHelp home page GithubHelp logo

yaoya / proton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yanghuan/proton

0.0 2.0 0.0 19.07 MB

Export excel to xml, json, lua, etc., and automatically generate the read code.

License: Other

Python 100.00%

proton's Introduction

English Chinese

proton

Proton is a excel export configuration file for the tool, you can export to xml, json, lua format, through external expansion can automatically generate the configuration to read the code, simple and flexible easy to use, indeed powerful.

Features

  • Writeing in Python,cross-platform, referenced xlrd only, full code, just more than 500 lines
  • Has a specific rule syntax description excel format information, simple and easy to understand, flexible and powerful, detailed description
  • Can export excel format information for external use, can be used to automatically generate read configuration code

Generates an auto-read code

Use the "-c" parameter to generate a json file containing excel format information, each language can be automatically generated to achieve this code to read the tool, the specific format. Has achieved the C # language tools, other language users, can be realized, welcomed the realization of the code links for the needs of people to use.

  • CSharpGeneratorForProton generates C # code that reads xml, json, protobuf. You can convert xml, json to protobuf's binary format and generate the corresponding read code (using protobuf-net).

Example

[sample directory] (https://github.com/sy-yanghuan/proton/tree/master/sample) is a well configured under the direct use of the Windows example. Already contains a python3 environment, directly run __export.bat to complete the export. Need to add a new Excel file, modify the __export.py related array.

Command Line Parameters

usage python proton.py [-p filelist] [-f outfolder] [-e format]
Arguments 
-p      : input excel files, use space to separate 
-f      : out folder
-e      : format, json or xml or lua     

Options
-s      :sign, controls whether the column is exported, defalut all export
-t      : suffix, export file suffix
-c      : a file path, save the excel structure to json, 
          the external program uses this file to automatically generate the read code      
-h      : print this help message and exit

Documentation

Wiki https://github.com/sy-yanghuan/proton/wiki/document_en
FAQ https://github.com/sy-yanghuan/proton/wiki/FAQ_en

License

Apache 2.0 license.


proton

proton是一个将excel导出为配置文件的工具,可以导出为xml、json、lua格式,通过外部扩展可支持自动生成读取配置的代码,简单灵活易于使用,确不失强大。

特点

  • python编写可跨平台使用,仅依赖第三方库xlrd完整代码仅500余行
  • 有特定的规则语法描述excel的格式信息,简洁易懂,灵活强大,详细说明
  • 可导出excel格式信息供外部程序使用,可用来自动生成读取配置的代码。

##后端程序(生成自动读取的代码) 使用“-c”参数可生成内含excel格式信息的json文件,各个语言可据此实现自动生成读取代码的工具,具体格式说明。已经实现了C#语言的工具,其他语言使用者,可自行实现,欢迎提供实现的代码链接,以供需要的同学使用。

  • CSharpGeneratorForProton 可生成读取xml、json、protobuf的C#代码。 可将xml、json转换为protobuf的二进制格式,并生成对应的读取代码(使用protobuf-net)。

实例工程

sample目录下是一个配置好了的可在windows下直接使用的实例。已经包含了python3环境,直接运行__export.bat即可完成导出。需要添加新的Excel文件,修改__export.py中相关数组,加入即可。

命令行参数

usage python proton.py [-p filelist] [-f outfolder] [-e format]
Arguments 
-p      : input excel files, use space to separate 
-f      : out folder
-e      : format, json or xml or lua     

Options
-s      :sign, controls whether the column is exported, defalut all export
-t      : suffix, export file suffix
-c      : a file path, save the excel structure to json, 
          the external program uses this file to automatically generate the read code      
-h      : print this help message and exit

##文档 格式说明 https://github.com/sy-yanghuan/proton/wiki/document_zh
FAQ https://github.com/sy-yanghuan/proton/wiki/FAQ_zh

##许可证 Apache 2.0 license.

proton's People

Contributors

yanghuan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.