{"id":28808545,"url":"https://github.com/floatingghost/flask-mongoengine-autocrud","last_synced_at":"2026-04-18T00:02:27.929Z","repository":{"id":102331423,"uuid":"160959568","full_name":"FloatingGhost/flask-mongoengine-autocrud","owner":"FloatingGhost","description":"Automatically generate a CRUD blueprint for a mongoengine object","archived":false,"fork":false,"pushed_at":"2018-12-08T17:33:10.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-07T05:29:49.214Z","etag":null,"topics":["automated","flask","mongodb","mongoengine","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FloatingGhost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-08T16:54:47.000Z","updated_at":"2021-04-09T18:24:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf0bfbc8-8612-40b8-9e12-184c1ab9d30b","html_url":"https://github.com/FloatingGhost/flask-mongoengine-autocrud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FloatingGhost/flask-mongoengine-autocrud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FloatingGhost%2Fflask-mongoengine-autocrud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FloatingGhost%2Fflask-mongoengine-autocrud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FloatingGhost%2Fflask-mongoengine-autocrud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FloatingGhost%2Fflask-mongoengine-autocrud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FloatingGhost","download_url":"https://codeload.github.com/FloatingGhost/flask-mongoengine-autocrud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FloatingGhost%2Fflask-mongoengine-autocrud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["automated","flask","mongodb","mongoengine","python"],"created_at":"2025-06-18T12:31:21.864Z","updated_at":"2026-04-18T00:02:27.913Z","avatar_url":"https://github.com/FloatingGhost.png","language":"Python","readme":"## Flask Mongoengine Autocrud\n\nNeed more crud in your life?\n\nme too.\n\nThe idea behind this is that, given a mongoengine type,\nwe can autogenerate a standard set of REST endpoints to\nfacilitate creation, modification, deletion and readification.\nMaybe search too. I think.\n\n### Usage\n\n```python3\n# In your blueprints folder\nfrom flask_mongoengine_autocrud import create_crud\nfrom models.my_model import SuperGoodModel\n\nmy_blueprint = create_crud(\n  SuperGoodModel,\n  \"super_good_blueprint\",\n  __name__\n)\n```\n\nand theoretically that's... it\n\nRegister the blueprint with flask in the standard way, and\nshould be good to go.\n\nNow we can use standard REST calls to do stuff\n\nThe following endpoints are created\n\n| Method | URL Pattern | Returns | Options |\n|--------|-------------|---------|--------|\n| GET    | /           | List of all items | page (int), size (int), for pagination |\n| GET    | /\\\u003cid\\\u003e       | A single item | |\n| POST   | /           | The created item | All valid mongoengine field names in POST body |\n| PATCH  | /\\\u003cid\\\u003e       | The modified item | All valid mongoengine field names |\n| DELETE | /\\\u003cid\\\u003e       | Success status | |\n| POST   | /search     | List of matching items | See search section |\n\nFor example\n\n```bash\n$ curl -XPOST /mydatatype/\n    --header \"Content-Type: application/json\" \\\n    --data-binary '{\"title\": \"my data\", \"admin\": true}'\n    http://myserver\n\n{\"title\": \"my data\", \"admin\": true, \"_id\": \"1234\"}\n\n$ curl -XPATCH /mydatatype/1234\n    --header \"Content-Type: application/json\" \\\n    --data-binary '{\"admin\": false}' \n    http://myserver\n\n{\"title\": \"my data\", \"admin\": false, \"_id\": \"1234\"}\n\n$ curl -XPOST /mydatatype/search\n    --header \"Content-Type: application/json\" \\\n    --data-binary '{\"filter\": {\"admin\": false}}' \n    http://myserver\n\n[{\"title\": \"my data\", \"admin\": false, \"_id\": \"1234\"}]\n\n$ curl -XDELETE /mydatatype/1234\n    --header \"Content-Type: application/json\" \\\n    --data-binary '{\"filter\": {\"admin\": false}}'\n    http://myserver\n\n{\"success\": true} \n```\n\n### Search\n\nSearch options should be posted as a JSON body in the following format\n\nAll fields are optional\n\n```json\n{\n  \"filter\": {\n    \"field_name\": \"field_value\",\n    ...\n  },\n  \"sort\": {\n    \"field_name\": \"direction (desc or asc)\"\n  },\n  \"size\": integer,\n  \"page\": integer\n}\n```\n\nThe `page` field *requires* the size field, else it'll be ignored.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatingghost%2Fflask-mongoengine-autocrud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloatingghost%2Fflask-mongoengine-autocrud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatingghost%2Fflask-mongoengine-autocrud/lists"}