{"id":15019694,"url":"https://github.com/abassel/flask-restglue","last_synced_at":"2025-08-03T22:39:10.044Z","repository":{"id":37093522,"uuid":"326479351","full_name":"abassel/Flask-RestGlue","owner":"abassel","description":"🚀 Integrates Flask + MongoDB(mongoengine) + OpenAPI in a simple and elegant way!","archived":false,"fork":false,"pushed_at":"2025-04-24T11:46:55.000Z","size":2586,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-12T21:51:22.339Z","etag":null,"topics":["flask","flask-restglue","mongoengine","openapi","openapi3","python-3","python3","rest"],"latest_commit_sha":null,"homepage":"https://abassel.github.io/Flask-RestGlue","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abassel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-03T18:56:36.000Z","updated_at":"2025-02-25T19:44:15.000Z","dependencies_parsed_at":"2023-02-18T10:18:16.232Z","dependency_job_id":"b83af0d0-f063-4545-8358-13954c32266e","html_url":"https://github.com/abassel/Flask-RestGlue","commit_stats":{"total_commits":642,"total_committers":4,"mean_commits":160.5,"dds":0.01869158878504673,"last_synced_commit":"6752d58d1a7cadcb3044ce58b0be1219147486bc"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/abassel/Flask-RestGlue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abassel%2FFlask-RestGlue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abassel%2FFlask-RestGlue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abassel%2FFlask-RestGlue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abassel%2FFlask-RestGlue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abassel","download_url":"https://codeload.github.com/abassel/Flask-RestGlue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abassel%2FFlask-RestGlue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268624130,"owners_count":24280148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","flask-restglue","mongoengine","openapi","openapi3","python-3","python3","rest"],"created_at":"2024-09-24T19:53:53.971Z","updated_at":"2025-08-03T22:39:09.991Z","avatar_url":"https://github.com/abassel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\u003c!-- PROJECT HEADER/LOGO --\u003e\n\u003c!-- \u003cbr /\u003e --\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003c!--\n  \u003ca href=\"https://github.com/abassel/Flask-RestGlue\"\u003e\n    \u003cimg src=\"images/logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n  --\u003e\n  \u003ch1 align=\"center\"\u003eFlask-RestGlue(ALPHA)\u003c/h1\u003e\n\n  \u003cp align=\"center\"\u003e\n    Integrates \u003cb\u003eFlask + MongoDB + OpenAPI\u003c/b\u003e in a simple and elegant way!\n    \u003cbr /\u003e\n    \u003ca href=\"https://abassel.github.io/Flask-RestGlue/\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/abassel/Flask-RestGlue#example\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/abassel/Flask-RestGlue/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/abassel/Flask-RestGlue/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n      \u003ca href=\"https://github.com/abassel/Flask-RestGlue/actions?query=workflow%3Abuild\"\u003e\u003cimg src=\"https://github.com/abassel/Flask-RestGlue/workflows/build/badge.svg?branch=master\u0026event=push\" alt=\"Stars Badge\"/\u003e\u003c/a\u003e\n      \u003ca href=\"https://github.com/abassel/Flask-RestGlue/pulls\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr/abassel/Flask-RestGlue\" alt=\"Pull Requests Badge\"/\u003e\u003c/a\u003e\n      \u003ca href=\"https://github.com/abassel/Flask-RestGlue/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/abassel/Flask-RestGlue\" alt=\"Issues Badge\"/\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n   \u003ca href=\"https://pypi.org/project/Flask-RestGlue/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/Flask-RestGlue.svg\" alt=\"Python Version\"/\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/abassel/Flask-RestGlue/releases\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/Flask-RestGlue?color=green\u0026label=version\" alt=\"Version\"/\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/abassel/Flask-RestGlue/pulls?utf8=%E2%9C%93\u0026q=is%3Apr%20author%3Aapp%2Fdependabot\"\u003e\u003cimg src=\"https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg\" alt=\"Dependencies Status\"/\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/PyCQA/bandit\"\u003e\u003cimg src=\"https://img.shields.io/badge/security-bandit-green.svg\" alt=\"Security: bandit\"/\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/abassel/Flask-RestGlue/blob/master/.pre-commit-config.yaml\"\u003e\u003cimg src=\"https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white\" alt=\"Pre-commit\"/\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/abassel/Flask-RestGlue/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/abassel/Flask-RestGlue\" alt=\"License\"/\u003e\u003c/a\u003e\n  \u003c/p\u003e\u003c/p\u003e\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n## Contents\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003c!--\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    --\u003e\n    \u003cli\u003e\u003ca href=\"#example\"\u003eExample\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#references-notebook\"\u003eReferences\u003c/a\u003e\u003c/li\u003e\n    \u003c!--\u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgements\"\u003eAcknowledgements\u003c/a\u003e\u003c/li\u003e--\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n# Example\n\nFor a fullstack boilerplate, visit [https://github.com/abassel/Flask_RestGlue_Svelte_Docker](https://github.com/abassel/Flask_RestGlue_Svelte_Docker)\n\n```python\nimport mongoengine as mongo\nfrom flask_rest_glue import FlaskRestGlue\n\nmongo.connect(\"pyglue\", host='localhost:27017')\n\napi = FlaskRestGlue()\n\n\n@api.rest_model()\nclass User(mongo.Document):\n  # id = mongo.StringField(primary_key=True)\n  email = mongo.StringField(primary_key=True)\n  password = mongo.StringField()\n\n\napi.run()\n\n```\n\nGo to [http://127.0.0.1:5000/spec_doc](http://127.0.0.1:5000/spec_doc) or [http://127.0.0.1:5000/spec_rdoc](http://127.0.0.1:5000/spec_rdoc) to see the documentation below:\n\n![Swagger UI](https://abassel.github.io/Flask-RestGlue/swagger.png)\n\n![ReText UI](https://abassel.github.io/Flask-RestGlue/rdoc.png)\n\n### Expected output:\n\n```bash\ncurl -v -d '{\"email\":\"a@b.com\",\"password\":\"xyz\"}' \\\n     -H \"Content-Type: application/json\" http://localhost:5000/user\n\n#\u003c HTTP/1.0 200 OK\n#\u003c Content-Type: application/json\n#\u003c Content-Length: 45\n#\u003c\n#{\n#  \"_id\": \"a@b.com\",\n#  \"password\": \"xyz\"\n#}\n\n\ncurl -v http://localhost:5000/users\n#\u003c HTTP/1.0 200 OK\n#\u003c Content-Type: application/json\n#\u003c Content-Length: 57\n#\u003c\n#[\n#  {\n#    \"_id\": \"a@b.com\",\n#    \"password\": \"xyz\"\n#  }\n#]\n\n\ncurl -v http://localhost:5000/user/a@b.com\n#\u003c HTTP/1.0 200 OK\n#\u003c Content-Type: application/json\n#\u003c Content-Length: 45\n#\u003c\n#{\n#  \"_id\": \"a@b.com\",\n#  \"password\": \"xyz\"\n#}\n\n\ncurl -v -X PUT -d '{\"password\":\"new_pass\"}' \\\n     -H \"Content-Type: application/json\" http://localhost:5000/user/a@b.com\n#\u003c HTTP/1.0 200 OK\n#\u003c Content-Type: application/json\n#\u003c Content-Length: 50\n#\u003c\n#{\n#  \"_id\": \"a@b.com\",\n#  \"password\": \"new_pass\"\n#}\n\n\ncurl -v -X DELETE http://localhost:5000/user/a@b.com\n#\u003c HTTP/1.0 200 OK\n#\u003c Content-Type: application/json\n#\u003c Content-Length: 45\n#\u003c\n#{\n#  \"_id\": \"a@b.com\",\n#  \"password\": \"xyz\"\n#}\n```\n\n\n# Quick Start\n\nRequires **docker** and **python 3.9**\n\n### 1 - install local MongoDB\n```bash\nmkdir -p ~/mongodata\n\ndocker run -d --rm -p 27017:27017 -v ~/mongodata:/data/db --name mongodb mongo\n```\n\n### 2 - Install this library\n```bash\npip install Flask-RestGlue\n```\n\n### 3 - Pull the code\n```bash\ncurl -s -O -L  https://github.com/abassel/Flask-RestGlue/blob/master/example/tut01_hello_world.py\ncurl -s -O -L  https://github.com/abassel/Flask-RestGlue/blob/master/example/tut01_hello_world.sh\n```\n\n### 4 - Run the code\n```bash\npython tut01_hello_world.py\n```\nIn another terminal window\n\n```bash\nbash tut01_hello_world.sh\n```\n\n## Road Map :car:\n\n- Evaluate https://testdriven.io/blog/fastapi-mongo/\n- Evaluate https://github.com/David-Lor/FastAPI-Pydantic-Mongo_Sample_CRUD_API\n- Evaluate https://art049.github.io/odmantic/\n- Example user model that stores password as hash - https://aaronluna.dev/series/flask-api-tutorial/part-2/\n- ORM examples for FastAPI - https://github.com/mjhea0/awesome-fastapi#orms\n- ODM examples for FastAPI - https://github.com/mjhea0/awesome-fastapi#odms\n- Authorization at row level - https://github.com/mjhea0/awesome-fastapi?tab=readme-ov-file#auth\n- Develop pagination\n- Develop Pydantic\n- Google search about flask api with sqlalchemy https://www.google.com/search?q=flask+api+sqlalchemy+tutorial\n- Evaluate flask api with migration https://aaronluna.dev/series/flask-api-tutorial/part-2/\n- Develop tools to generate typescript or svelte stubs\n- Create a template like https://github.com/tiangolo/full-stack-fastapi-template\n\n## References :notebook:\n- [Flask_RestGlue_Svelte_Docker boilerplate](https://github.com/abassel/Flask_RestGlue_Svelte_Docker)\n- [OpenAPI 3.0.3](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md)\n- [Flask](http://flask.pocoo.org)\n- [Mongoengine](https://github.com/MongoEngine/mongoengine)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabassel%2Fflask-restglue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabassel%2Fflask-restglue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabassel%2Fflask-restglue/lists"}