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 .
快速开始
- 基础示例:创建第一个 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)
-
运行服务 python your_script.py
响应:{"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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apienginedivine-0.1.1.tar.gz.
File metadata
- Download URL: apienginedivine-0.1.1.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
660a307aa4cb267c4b429d3c7962f152bbfbe3b9851d57547cebad441e795b03
|
|
| MD5 |
751c21b14ba1ca8faa9647302b70bde2
|
|
| BLAKE2b-256 |
0e12e5e3fc3698ea58dc821413d34af8ac89e8ebd9eb729fa54bb8fe84e5aadd
|
File details
Details for the file apienginedivine-0.1.1-py3-none-any.whl.
File metadata
- Download URL: apienginedivine-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e50391787b2e5042ad032ffaabbc22f570786e5061e235007bcb3757f0439d6b
|
|
| MD5 |
6b35eb229c82f76a63654ab46793a8d4
|
|
| BLAKE2b-256 |
e07f9c5648e1c4f8113b724b05e6fc8af954aac370381c3868eb4500fc283b70
|