GithubHelp home page GithubHelp logo

flask_to_quart_converter's Introduction

基于 AST 将 Flask 代码转成 Quart 代码

本脚本用于将 flask 的代码转换为 quart 的代码。只处理简单的情况,复杂的情况需要手动处理。

  1. 请先使用 git 等工具备份好代码! 请务必备份!脚本一旦运行,会直接覆盖原始代码!
  2. 此脚本默认 只转换 xxx/views.py 文件 ,如果有其他文件需要转换,请手动修改代码。
  3. 此脚本只处理下列情况, 不包含修改导入等 (这个可以用编辑器的替换功能来做,比如把 flask -> quart, Flask -> Quart, FLASK -> QUART)
  4. 因为 ast 的限制,源代码的 所有注释都会丢失!
  5. 不保证转换后的代码能正常运行,请手动检查。

分为两个文件:

  • lib 为主体代码,包括全部逻辑,单独运行用于测试
  • convert_to_quart.py 为转换代码,用于转换 Flask 项目,会通过命令行的交互式操作来完成转换

实现细节请参阅 Blog

flask_to_quart_converter's People

Contributors

funnysaltyfish 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.