Skip to main content

this is a api engine

Project description

apiEngineDivine ** 轻量、高效的 Python API 开发引擎,帮助开发者快速构建可扩展、易维护的 API 服务。 项目介绍 apiEngineDivine 是一款专注于 API 开发的轻量化引擎,提供简洁的接口定义、请求处理、响应格式化等核心能力,适用于快速开发 RESTful API 服务、接口中间件等场景。 安装说明 前提条件 Python 3.11 及以上版本 安装方式

直接安装(需先发布到 PyPI,或使用本地安装)

pip install apiEngineDivine

本地开发安装

git clone <项目仓库地址> cd apiEngineDivine pip install -e .

快速开始

  1. 基础示例:创建第一个 API 服务 from apiEngineDivine import ApiEngine, Request, Response

初始化 API 引擎

app = ApiEngine()

定义接口路由

@app.route("/api/hello", methods=["GET"]) def hello_world(request: Request) -> Response: # 获取请求参数 name = request.query.get("name", "Guest") # 返回响应 return Response(data={"message": f"Hello, {name}!"}, status_code=200)

启动服务

if name == "main": app.run(host="0.0.0.0", port=8000)

  1. 运行服务 python your_script.py

  2. 测试接口 curl http://localhost:8000/api/hello?name=Divine

响应:{"message": "Hello, Divine!"}

核心功能 ✅ 简洁的路由注册机制(支持 GET/POST/PUT/DELETE 等方法) ✅ 统一的请求 / 响应处理封装 ✅ 灵活的参数解析(Query/Form/JSON 数据) ✅ 可扩展的中间件机制 ✅ 跨平台兼容(Windows/Linux/macOS) 详细文档 使用指南:完整的功能使用说明 接口参考:所有 API 接口的详细文档 示例项目:更多场景化的使用示例 许可证 本项目基于 Apache License 2.0 开源协议,详情请查看 LICENSE 文件。 作者信息 作者:Divine 邮箱:294491521@qq.com 项目仓库:<补充项目仓库地址> 贡献指南 Fork 本仓库 创建特性分支(git checkout -b feature/amazing-feature) 提交代码(git commit -m 'Add some amazing feature') 推送分支(git push origin feature/amazing-feature) 打开 Pull Request 欢迎提交 Issue 和 PR,一起完善项目!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apienginedivine-0.1.2.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apienginedivine-0.1.2-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file apienginedivine-0.1.2.tar.gz.

File metadata

  • Download URL: apienginedivine-0.1.2.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for apienginedivine-0.1.2.tar.gz
Algorithm Hash digest
SHA256 64563852a7bb4fbc6c78da2983872759f1e865f01bca582b097331ee6183aab3
MD5 889dc50b86007d84c7873ed6b7b67def
BLAKE2b-256 cd8f665e53b13846e4adfaa95adb2816c64a2843743be21c1431e9ddeb2cd343

See more details on using hashes here.

File details

Details for the file apienginedivine-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for apienginedivine-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 032179ccd368b5dbbe6059a87ea5fd5713c475aa13660b1f119b9f044e385fae
MD5 0dbf2370d3e71be9431747aa35798de8
BLAKE2b-256 83762338f43a2cef37cba159ef7c4056475de1bab7374d2e32b326d355017297

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page