fastapi-sqlmodel-starter


Namefastapi-sqlmodel-starter JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/tyvekzhang/fastapi-sqlmodel-starter
SummaryFss aims to be one of top scaffold in PyWeb.
upload_time2024-04-20 15:52:01
maintainertyvekZhang
docs_urlNone
authortyvekZhang
requires_python<4.0,>=3.9
licenseMIT
keywords fastapi sqlmodel tools web scaffold
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div  align="center" style="margin-top: 3%">
   <h1>
     FastAPI SQLModel Starter (Fss)
   </h1>
   <p>
     <img src="https://raw.githubusercontent.com/tyvekzhang/fastapi-sqlmodel-starter/main/docs/source/_static/img/fss.svg" alt="logo" style="vertical-align:middle; margin: 0.5%"/>
   </p>
   <p>
     <img alt="GitHub License" src="https://img.shields.io/github/license/tyvekzhang/fastapi-sqlmodel-starter">
     <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/fastapi-sqlmodel-starter">
     <img alt="CI" src="https://github.com/tyvekzhang/fastapi-sqlmodel-starter/actions/workflows/ci.yaml/badge.svg">
     <img alt="Codecov" src="https://img.shields.io/codecov/c/github/tyvekzhang/fastapi-sqlmodel-starter">
     <img alt="Read the Docs" src="https://img.shields.io/readthedocs/fastapi-sqlmodel-starter">
   </p>
   <h4>
      <p>
        <b>简体中文</b> |
        <a href="https://github.com/tyvekzhang/fastapi-sqlmodel-starter/blob/main/docs/README_en.md">English</a>
     </p>
   </h4>
   <h3>
    PyWeb领域最好用的脚手架之一。
   </h3>
</div>


## 特性

- ⚡ 开箱即用, 实现中间件的零依赖
   - 默认使用Sqlite, 也可自由切换PostgreSQL、MySQL数据库
   - 可选文件或Redis缓存
- 🚢 开启Python代码操作数据库的新体验
- 🚀 简化ORM操作, 内置单表常见操作
- 🎨 丰富的插件机制
   - Jwt安全认证
   - 访问限流
   - Ip黑名单
- 🐋 完备的容器化解决方案
  - Docker
  - Docker-compose
  - Kubernetes
- ✅ 基于GitHub Actions的CI (持续集成) 和 CD (持续交付)

## 文档
- 交互式API文档
  <img alt="API doc"  src="https://raw.githubusercontent.com/tyvekzhang/fastapi-sqlmodel-starter/main/docs/img/api_doc.png">
- 在线文档: [Read the docs](https://fastapi-sqlmodel-starter.readthedocs.io/en/latest/)

## 快速开始
1. 首先确保python版本为3.9及以上
2. 克隆代码
```shell
git clone https://github.com/tyvekzhang/fastapi-sqlmodel-starter
cd fastapi-sqlmodel-starter/fss
```
3. [可选]创建虚拟环境, 本篇以venv为例, 类似的工具还有conda, virtualenv等
```shell
python3 -m venv .env_fss
```
4. [可选]激活虚拟环境
    - Windows: .env_fss\Scripts\activate
    - macOS 或 Linux: source .env_fss/bin/activate
5. 安装 Poetry并下载依赖
```shell
pip install poetry --trusted-host=mirrors.tuna.tsinghua.edu.cn --index-url=https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
poetry install
```
6. 数据库迁移
```shell
alembic upgrade head
```
7. 启动
   - Windows: python3 apiserver.py
   - macOS 或 Linux: python3 apiserver.py
8. 访问: http://127.0.0.1:9010/docs
> 成功访问后需要创建用户并认证

## 贡献

欢迎为 FastapiSqlmodelStarter 做出贡献!你可以通过以下方式参与:

- 提交 Bug 或功能需求到 [Issue清单](https://github.com/tyvekzhang/fastapi-sqlmodel-starter/issues)
- 提交代码改进的 Pull Request
- 编写和改进文档
- 分享你使用 FastapiSqlmodelStarter 的经验和想法

## 许可证

FastapiSqlmodelStarter 采用 [MIT 许可证](https://opensource.org/licenses/MIT)开源。

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tyvekzhang/fastapi-sqlmodel-starter",
    "name": "fastapi-sqlmodel-starter",
    "maintainer": "tyvekZhang",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": "tyvekzhang@gmail.com",
    "keywords": "fastapi, sqlmodel, tools, web, scaffold",
    "author": "tyvekZhang",
    "author_email": "tyvekzhang@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/73/9f/3dd3deec77c878645fb237f6627db0b1cf0a1176409ca0a89258a86992d8/fastapi_sqlmodel_starter-1.0.1.tar.gz",
    "platform": null,
    "description": "<div  align=\"center\" style=\"margin-top: 3%\">\n   <h1>\n     FastAPI SQLModel Starter (Fss)\n   </h1>\n   <p>\n     <img src=\"https://raw.githubusercontent.com/tyvekzhang/fastapi-sqlmodel-starter/main/docs/source/_static/img/fss.svg\" alt=\"logo\" style=\"vertical-align:middle; margin: 0.5%\"/>\n   </p>\n   <p>\n     <img alt=\"GitHub License\" src=\"https://img.shields.io/github/license/tyvekzhang/fastapi-sqlmodel-starter\">\n     <img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/fastapi-sqlmodel-starter\">\n     <img alt=\"CI\" src=\"https://github.com/tyvekzhang/fastapi-sqlmodel-starter/actions/workflows/ci.yaml/badge.svg\">\n     <img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/tyvekzhang/fastapi-sqlmodel-starter\">\n     <img alt=\"Read the Docs\" src=\"https://img.shields.io/readthedocs/fastapi-sqlmodel-starter\">\n   </p>\n   <h4>\n      <p>\n        <b>\u7b80\u4f53\u4e2d\u6587</b> |\n        <a href=\"https://github.com/tyvekzhang/fastapi-sqlmodel-starter/blob/main/docs/README_en.md\">English</a>\n     </p>\n   </h4>\n   <h3>\n    PyWeb\u9886\u57df\u6700\u597d\u7528\u7684\u811a\u624b\u67b6\u4e4b\u4e00\u3002\n   </h3>\n</div>\n\n\n## \u7279\u6027\n\n- \u26a1 \u5f00\u7bb1\u5373\u7528, \u5b9e\u73b0\u4e2d\u95f4\u4ef6\u7684\u96f6\u4f9d\u8d56\n   - \u9ed8\u8ba4\u4f7f\u7528Sqlite, \u4e5f\u53ef\u81ea\u7531\u5207\u6362PostgreSQL\u3001MySQL\u6570\u636e\u5e93\n   - \u53ef\u9009\u6587\u4ef6\u6216Redis\u7f13\u5b58\n- \ud83d\udea2 \u5f00\u542fPython\u4ee3\u7801\u64cd\u4f5c\u6570\u636e\u5e93\u7684\u65b0\u4f53\u9a8c\n- \ud83d\ude80 \u7b80\u5316ORM\u64cd\u4f5c, \u5185\u7f6e\u5355\u8868\u5e38\u89c1\u64cd\u4f5c\n- \ud83c\udfa8 \u4e30\u5bcc\u7684\u63d2\u4ef6\u673a\u5236\n   - Jwt\u5b89\u5168\u8ba4\u8bc1\n   - \u8bbf\u95ee\u9650\u6d41\n   - Ip\u9ed1\u540d\u5355\n- \ud83d\udc0b \u5b8c\u5907\u7684\u5bb9\u5668\u5316\u89e3\u51b3\u65b9\u6848\n  - Docker\n  - Docker-compose\n  - Kubernetes\n- \u2705 \u57fa\u4e8eGitHub Actions\u7684CI (\u6301\u7eed\u96c6\u6210) \u548c CD (\u6301\u7eed\u4ea4\u4ed8)\n\n## \u6587\u6863\n- \u4ea4\u4e92\u5f0fAPI\u6587\u6863\n  <img alt=\"API doc\"  src=\"https://raw.githubusercontent.com/tyvekzhang/fastapi-sqlmodel-starter/main/docs/img/api_doc.png\">\n- \u5728\u7ebf\u6587\u6863: [Read the docs](https://fastapi-sqlmodel-starter.readthedocs.io/en/latest/)\n\n## \u5feb\u901f\u5f00\u59cb\n1. \u9996\u5148\u786e\u4fddpython\u7248\u672c\u4e3a3.9\u53ca\u4ee5\u4e0a\n2. \u514b\u9686\u4ee3\u7801\n```shell\ngit clone https://github.com/tyvekzhang/fastapi-sqlmodel-starter\ncd fastapi-sqlmodel-starter/fss\n```\n3. [\u53ef\u9009]\u521b\u5efa\u865a\u62df\u73af\u5883, \u672c\u7bc7\u4ee5venv\u4e3a\u4f8b, \u7c7b\u4f3c\u7684\u5de5\u5177\u8fd8\u6709conda, virtualenv\u7b49\n```shell\npython3 -m venv .env_fss\n```\n4. [\u53ef\u9009]\u6fc0\u6d3b\u865a\u62df\u73af\u5883\n    - Windows: .env_fss\\Scripts\\activate\n    - macOS \u6216 Linux: source .env_fss/bin/activate\n5. \u5b89\u88c5 Poetry\u5e76\u4e0b\u8f7d\u4f9d\u8d56\n```shell\npip install poetry --trusted-host=mirrors.tuna.tsinghua.edu.cn --index-url=https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple\npoetry install\n```\n6. \u6570\u636e\u5e93\u8fc1\u79fb\n```shell\nalembic upgrade head\n```\n7. \u542f\u52a8\n   - Windows: python3 apiserver.py\n   - macOS \u6216 Linux: python3 apiserver.py\n8. \u8bbf\u95ee: http://127.0.0.1:9010/docs\n> \u6210\u529f\u8bbf\u95ee\u540e\u9700\u8981\u521b\u5efa\u7528\u6237\u5e76\u8ba4\u8bc1\n\n## \u8d21\u732e\n\n\u6b22\u8fce\u4e3a FastapiSqlmodelStarter \u505a\u51fa\u8d21\u732e\uff01\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u53c2\u4e0e\uff1a\n\n- \u63d0\u4ea4 Bug \u6216\u529f\u80fd\u9700\u6c42\u5230 [Issue\u6e05\u5355](https://github.com/tyvekzhang/fastapi-sqlmodel-starter/issues)\n- \u63d0\u4ea4\u4ee3\u7801\u6539\u8fdb\u7684 Pull Request\n- \u7f16\u5199\u548c\u6539\u8fdb\u6587\u6863\n- \u5206\u4eab\u4f60\u4f7f\u7528 FastapiSqlmodelStarter \u7684\u7ecf\u9a8c\u548c\u60f3\u6cd5\n\n## \u8bb8\u53ef\u8bc1\n\nFastapiSqlmodelStarter \u91c7\u7528 [MIT \u8bb8\u53ef\u8bc1](https://opensource.org/licenses/MIT)\u5f00\u6e90\u3002\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Fss aims to be one of top scaffold in PyWeb.",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://github.com/tyvekzhang/fastapi-sqlmodel-starter/wiki",
        "Homepage": "https://github.com/tyvekzhang/fastapi-sqlmodel-starter",
        "Repository": "https://github.com/tyvekzhang/fastapi-sqlmodel-starter"
    },
    "split_keywords": [
        "fastapi",
        " sqlmodel",
        " tools",
        " web",
        " scaffold"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "578a23e5c57a33c01e5ba0f78516e177edf791f0322a679804096821b7a65511",
                "md5": "d5292a77fd3891683ca23768a3a9f87a",
                "sha256": "9bac944ccac0f7405592927db3a109ceb3e8b80912c846969e1473a2c2e9ef12"
            },
            "downloads": -1,
            "filename": "fastapi_sqlmodel_starter-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d5292a77fd3891683ca23768a3a9f87a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 49736,
            "upload_time": "2024-04-20T15:51:58",
            "upload_time_iso_8601": "2024-04-20T15:51:58.426340Z",
            "url": "https://files.pythonhosted.org/packages/57/8a/23e5c57a33c01e5ba0f78516e177edf791f0322a679804096821b7a65511/fastapi_sqlmodel_starter-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "739f3dd3deec77c878645fb237f6627db0b1cf0a1176409ca0a89258a86992d8",
                "md5": "4d39b7f135d246c68c235c40d9916e52",
                "sha256": "216b9f4035b924f5634c95d013f66f0f0b78bae47a020e12f493aeff0debf5f5"
            },
            "downloads": -1,
            "filename": "fastapi_sqlmodel_starter-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4d39b7f135d246c68c235c40d9916e52",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 90219,
            "upload_time": "2024-04-20T15:52:01",
            "upload_time_iso_8601": "2024-04-20T15:52:01.991666Z",
            "url": "https://files.pythonhosted.org/packages/73/9f/3dd3deec77c878645fb237f6627db0b1cf0a1176409ca0a89258a86992d8/fastapi_sqlmodel_starter-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-20 15:52:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tyvekzhang",
    "github_project": "fastapi-sqlmodel-starter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fastapi-sqlmodel-starter"
}
        
Elapsed time: 0.24849s