{"id":18613952,"url":"https://github.com/enthought/flask-apiblueprint","last_synced_at":"2025-08-28T12:11:18.405Z","repository":{"id":66039653,"uuid":"68701016","full_name":"enthought/flask-apiblueprint","owner":"enthought","description":"Default Repo description from terraform module","archived":false,"fork":false,"pushed_at":"2016-09-20T20:57:59.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-17T01:09:55.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enthought.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2016-09-20T10:28:42.000Z","updated_at":"2021-06-01T16:20:38.000Z","dependencies_parsed_at":"2023-05-02T15:16:35.935Z","dependency_job_id":null,"html_url":"https://github.com/enthought/flask-apiblueprint","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/enthought/flask-apiblueprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fflask-apiblueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fflask-apiblueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fflask-apiblueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fflask-apiblueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enthought","download_url":"https://codeload.github.com/enthought/flask-apiblueprint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fflask-apiblueprint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272496996,"owners_count":24944608,"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-28T02:00:10.768Z","response_time":74,"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":[],"created_at":"2024-11-07T03:24:28.173Z","updated_at":"2025-08-28T12:11:18.351Z","avatar_url":"https://github.com/enthought.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Flask-APIBlueprint\n==================\n\nWhat is Flask-APIBlueprint?\n-------------------------\nFlask-APIBlueprint is a Flask micro-framework extension which adds support for\nroute inheritance for Blueprints.\n\nIf you're building an API with Blueprints in Flask, you don't have to redeclare the routes if using the `APIBlueprint` class. You can also override routes as you version your API and remap endpoints.\n\n#### What do I need?\n\nFlask. It will automatically be installed if you install the extension via pip:\n\n```\n$ pip install flask-apiblueprint\n```\n\n\n#### Where are the tests?\n\nTo run the tests use the `test_apiblueprint.py` file:\n\n```\n$ python test_apiblueprint.py\n```\n\n#### How do I implement this?\n\n##### Inheritance\nUse the `inherit_from` keyword argument in the `APIBlueprint` constructor to copy routes over from another `APIBlueprint`.\n\n```\napi_v2 = APIBlueprint(\n    'api_v2', __name__, subdomain='', url_prefix='/api/v2', inherit_from=api_v1\n)\n```\n\n##### Override routes\nTo override copied routes, just redeclare them.\n\n```\n@api_v1.route('/user/\u003cuser_id\u003e/')\ndef username(user_id):\n    username = User.query.get(user_id).username\n    return jsonify(username=username)\n\n@api_v2.route('/user/\u003cuser_id\u003e/')\ndef user_info(user_id):\n    username = User.query.get(user_id).username\n    firstname = User.query.get(user_id).firstname\n    return jsonify(data=dict(username=username, firstname=firstname))\n```\n\n##### Remap endpoints\nUse the `remapping` keyword argument in the constructor to change the endpoints of inherited routes.\n\n```\nremapping = {'/users/list/': '/users/'}\n\napi_v2 = APIBlueprint(\n    'api_v2', __name__, subdomain='', url_prefix='/api/v2', inherit_from=api_v1,\n    remapping=remapping\n)\n\n```\n\nSee the [docs](http://flask-apiblueprint.readthedocs.org/en/latest/) for more details or run the `app.py` file to see how the [sample_api](sample_api) is implemented.\n\n```\n$ python app.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenthought%2Fflask-apiblueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenthought%2Fflask-apiblueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenthought%2Fflask-apiblueprint/lists"}