# seatools uvicorn 启动器
## 使用指南
1. 安装, `poetry add seatools-server-uvicorn`
2. 假设`xxx.boot`模块存在`start`的启动`ioc`函数
```python
from seatools import run
def start():
run('xxx', './config')
```
命令行启动`uvicorn xxx.boot:start xxx.fastapi.app:app`, 其他参数与官方`uvicorn`一致, 在`uvicorn`基础上增加了一个`ioc_app`的参数, 需要指明`ioc`应用启动的函数
3. 程序直接调用
```python
from xxx.boot import start
from seatools.ioc.server import uvicorn
def main():
uvicorn.run(start, 'xxx.fastapi.app:app')
if __name__ == '__main__':
main()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "seatools-server-uvicorn",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "seatools, server, uvicorn",
"author": null,
"author_email": "seatools-py <521274311@qq.com>",
"download_url": "https://files.pythonhosted.org/packages/55/f2/5051ff06b9dd99f0d588184eb7f732d131367f8c90c38962cc1ea3709f1e/seatools_server_uvicorn-1.0.1.tar.gz",
"platform": null,
"description": "# seatools uvicorn \u542f\u52a8\u5668\n\n## \u4f7f\u7528\u6307\u5357\n1. \u5b89\u88c5, `poetry add seatools-server-uvicorn`\n2. \u5047\u8bbe`xxx.boot`\u6a21\u5757\u5b58\u5728`start`\u7684\u542f\u52a8`ioc`\u51fd\u6570\n\n```python\nfrom seatools import run\n\n\ndef start():\n run('xxx', './config')\n\n```\n\u547d\u4ee4\u884c\u542f\u52a8`uvicorn xxx.boot:start xxx.fastapi.app:app`, \u5176\u4ed6\u53c2\u6570\u4e0e\u5b98\u65b9`uvicorn`\u4e00\u81f4, \u5728`uvicorn`\u57fa\u7840\u4e0a\u589e\u52a0\u4e86\u4e00\u4e2a`ioc_app`\u7684\u53c2\u6570, \u9700\u8981\u6307\u660e`ioc`\u5e94\u7528\u542f\u52a8\u7684\u51fd\u6570\n3. \u7a0b\u5e8f\u76f4\u63a5\u8c03\u7528\n\n```python\nfrom xxx.boot import start\nfrom seatools.ioc.server import uvicorn\n\n\ndef main():\n uvicorn.run(start, 'xxx.fastapi.app:app')\n\n\nif __name__ == '__main__':\n main()\n\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "Seatools Server Uvicorn",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/seatools-py/seatools-server-uvicorn",
"Issues": "https://github.com/seatools-py/seatools-server-uvicorn/issues"
},
"split_keywords": [
"seatools",
" server",
" uvicorn"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "669330bca1ed704099ecdcc0d3d9bfd8986e79d8bd9975425a0dab1d0c4df7bd",
"md5": "6d4ca8a9f4a87b14c4b81c8441efb887",
"sha256": "e90a0dc22fac127fdb1d3fe7cf5ec6a098fe39c31148027eab7444b75d07dc6a"
},
"downloads": -1,
"filename": "seatools_server_uvicorn-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6d4ca8a9f4a87b14c4b81c8441efb887",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 8341,
"upload_time": "2024-12-12T10:51:03",
"upload_time_iso_8601": "2024-12-12T10:51:03.759411Z",
"url": "https://files.pythonhosted.org/packages/66/93/30bca1ed704099ecdcc0d3d9bfd8986e79d8bd9975425a0dab1d0c4df7bd/seatools_server_uvicorn-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "55f25051ff06b9dd99f0d588184eb7f732d131367f8c90c38962cc1ea3709f1e",
"md5": "cfed12a26f9fb247dbae8a0ff00d4200",
"sha256": "777f0753efd6d481c45d45377ee48854e8f53d2dd72ab554ef6754122f8b6860"
},
"downloads": -1,
"filename": "seatools_server_uvicorn-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "cfed12a26f9fb247dbae8a0ff00d4200",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 7159,
"upload_time": "2024-12-12T10:51:06",
"upload_time_iso_8601": "2024-12-12T10:51:06.744903Z",
"url": "https://files.pythonhosted.org/packages/55/f2/5051ff06b9dd99f0d588184eb7f732d131367f8c90c38962cc1ea3709f1e/seatools_server_uvicorn-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 10:51:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "seatools-py",
"github_project": "seatools-server-uvicorn",
"github_not_found": true,
"lcname": "seatools-server-uvicorn"
}