{"id":14065466,"url":"https://github.com/ovh/python-apispec-fromfile","last_synced_at":"2026-02-18T20:07:34.735Z","repository":{"id":42001471,"uuid":"323276717","full_name":"ovh/python-apispec-fromfile","owner":"ovh","description":"APISpec plugin to import OpenAPI specifications from a file","archived":false,"fork":false,"pushed_at":"2022-06-24T19:06:51.000Z","size":28,"stargazers_count":18,"open_issues_count":1,"forks_count":4,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-03-15T01:20:24.687Z","etag":null,"topics":["apispec","openapi","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ovh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-21T08:35:55.000Z","updated_at":"2023-03-03T17:45:56.000Z","dependencies_parsed_at":"2022-08-12T02:00:30.856Z","dependency_job_id":null,"html_url":"https://github.com/ovh/python-apispec-fromfile","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovh%2Fpython-apispec-fromfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovh%2Fpython-apispec-fromfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovh%2Fpython-apispec-fromfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovh%2Fpython-apispec-fromfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ovh","download_url":"https://codeload.github.com/ovh/python-apispec-fromfile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755388,"owners_count":20990616,"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","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":["apispec","openapi","python"],"created_at":"2024-08-13T07:04:30.475Z","updated_at":"2026-02-18T20:07:29.686Z","avatar_url":"https://github.com/ovh.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# APISpec-fromfile\n\n[![Tests Status](https://github.com/ovh/python-apispec-fromfile/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ovh/python-apispec-fromfile/actions/workflows/tests.yml)\n[![PyPI version](https://img.shields.io/pypi/v/apispec-fromfile)](https://pypi.python.org/pypi/apispec-fromfile)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/apispec-fromfile.svg)](https://pypi.python.org/pypi/apispec-fromfile)\n\n\n[APISpec](https://apispec.readthedocs.io/en/latest/) plugin to import [OpenAPI specifications](https://github.com/OAI/OpenAPI-Specification) from a file instead of putting YAML into docstrings.\n\n\n## Installation\n\n```console\n    pip install apispec-fromfile\n```\n\n## Usage\n\nCreate a YAML file `my/spec/file.yml`:\n\n```yaml\n---\nget:\n  summary: Hello\n  operationId: hello\n  responses:\n    200:\n      content:\n        application/json:\n          schema:\n            type: string\n```\n\n\nThen, use APISpec in your Python code:\n\n```python\nfrom apispec import APISpec\nfrom apispec_fromfile import FromFilePlugin\nfrom apispec_fromfile import from_file\n\n# Create an APISpec\nspec = APISpec(\n    title=\"Swagger Petstore\",\n    version=\"1.0.0\",\n    openapi_version=\"3.0.3\",\n    plugins=[\n        FromFilePlugin(\"resource\"),\n    ],\n)\n\n# Create an endpoint\n@from_file(\"my/spec/file.yml\")\ndef hello():\n    return {\"hello\"}\n\n# Register entities and paths\nspec.path(\"/hello\", resource=hello)\n```\n\n# Related links\n\n* Contribute: https://github.com/ovh/python-apispec-fromfile/blob/master/CONTRIBUTING.md\n* Report bugs: https://github.com/ovh/python-apispec-fromfile/issues\n* Get latest version: https://pypi.org/project/apispec-fromfile\n\n# License\n\nCopyright 2020 OVH SAS\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovh%2Fpython-apispec-fromfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovh%2Fpython-apispec-fromfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovh%2Fpython-apispec-fromfile/lists"}