Giter VIP home page Giter VIP logo

dfs-generate's Introduction

dfs-generate

dfs-generate

通过已有数据库表,生成FastAPI接口的工具项目,最终目的为FastAPI使用者,减少代码; 项目启发 Mybatis 逆向工程、pdmaner

  • d -> db 数据库
  • f -> fastapi + uvicorn 接口服务
  • s -> sqlmodel 数据实体、ORM模型

使用过程中有疑问、或其他宝贵意见 -> issues,如果你对这个项目感兴趣,欢迎加入共同实现,

为什么不是其他

个人观点

  1. 目前Tortoise ORMDjango Ninja通过模型直接生成对应的Pydantic模型,均采用的 动态创建模型,在Pycharm.属性无代码提示。
  2. SQLModel 已有表生成模型,模型生成表,官方还未提供。
  3. fastapi-crudrouter 内部通过add_router方式注册路由,虽然代码减少了,但是灵活性变低了
  4. 或该更多的使用表之间逻辑关联

亮点

几乎没有亮点、代码质量也差

  1. 项目本身Web服务、和生成的代码均使用 Pydantic 2.xFastAPI, SQLModel 版本
  2. 将持续维护,欢迎一起加入。
  3. 目前生成的代码非async,仅支持MySQL DB, 生成的代码分层不够清晰(还没抄到好的),项目本身代码质量差(全是字符串format),生成的SQLModel 表模型部分类型待完善

上图

home conf model_code router_code db_code

使用项目

项目本身语言版本 Python3.8

  1. 拉取本项目
git clone https://github.com/zy7y/dfs-generate.git
  1. 安装依赖
# 可跳过:安装并使用虚拟环境
python -m venv venv
# 进入虚拟环境
# win
venv\Script\activate
# mac / linux
source venv/bin/activate
# 安装依赖
pip install -r requrements.txt -i  https://mirrors.aliyun.com/pypi/simple/
  1. 启动项目
python main.py
  1. 浏览器访问
http://127.0.0.1:80

dfs-generate's People

Contributors

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