fastapi-tag


Namefastapi-tag JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryModule for fastapi help to ensure the Metadata of the API
upload_time2024-03-09 06:54:23
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords fastapi metadata openapi pydantic restful
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FastAPI Tag

<p align="center">
<a href="https://github.com/yezz123/fastapi-tag" target="_blank">
    <img src="https://raw.githubusercontent.com/yezz123/fastapi-tag/main/.github/logo.png" alt="FastAPI Tag">
</a>
<p align="center">
    <em>Documented & Enhance the Metadata of your API ✨</em>
</p>
<p align="center">
<a href="https://github.com/yezz123/fastapi-tag/actions/workflows/ci.yml" target="_blank">
    <img src="https://github.com/yezz123/fastapi-tag/actions/workflows/ci.yml/badge.svg" alt="Continuous Integration">
</a>
<a href="https://pypi.org/project/fastapi-tag" target="_blank">
    <img src="https://img.shields.io/pypi/v/pgqb?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://codecov.io/gh/yezz123/fastapi-tag">
    <img src="https://codecov.io/gh/yezz123/fastapi-tag/branch/main/graph/badge.svg"/>
</a>
</p>
</p>

A simple Package could be added to your FastAPI Project to enhance the metadata of your Project and documenting your API with more information.

---

**Source Code**: <https://github.com/yezz123/fastapi-tag>

**Install the project**: `pip install fastapi-tag`

---

## Features 🎉

- Add a tag to your API, which can be used to filter the API documentation.
- Add a description to your API, which can be used to describe the API.
- Add a version to your API, which can be used to describe the version of the API and app.
- Provide some others features like:
  - `API_id`: A unique identifier for the API.
  - `Audience`: The audience of the API (e.g. `public`, `internal`, `external`).
- Tested in python 3.8 and up.
- Last Version of FastAPI :rocket:

## Usage 📚

- To Identify the Metadata of your API:

```py
from fastapi import FastAPI
from fastapi_tag.model import Contact, Metadata, Version
from fastapi_tag.application import Application

app = FastAPI()

def metadata(app):
    return Metadata(
        title="Hello World",
        version=Version(app="v0.1.1", api="v0.1.0"),
        description="A simple example of a FastAPI application.",
        contact=Contact(
            name="name",
            url="http://test.com",
            email=None
        ),
        api_id="49786b4b-1889-46ec-bd72-27f332436e6f",
        audience="company-internal",
    )

def app(metadata):
    return Application("", metadata)
```

- We have also `Problem` class thats depends on:
  - `title`: The title of the problem.
  - `status`: The status code of the problem.
  - `detail`: A human-readable explanation specific to this occurrence of the problem.
  - `instance`: A URI reference that identifies the specific occurrence of the problem.
  - `type`: A URI reference that identifies the problem type.

- `NameSpace` is a is a decorator that adds a route generator to the namespace object.

for example:

```py
from fastapi_tag.routers import Namespace

route = Namespace([])
```

## Development

### Setup environment

You should create a virtual environment and activate it:

> **Notes:** You need to have `python3.9` or higher installed.

I Use `uv` to manage virtual environments, you can install it with:

```bash
# Install uv
pip install uv

# Create a virtual environment
uv venv

# Activate the virtual environment
source .venv/bin/activate
```

And then install the development dependencies:

```bash
# Install dependencies
uv pip install -e .[test,lint]
```

### Run tests 🌝

You can run all the tests with:

```bash
bash scripts/tests.sh
```

### Format the code 🍂

Execute the following command to apply `pre-commit` formatting:

```bash
bash scripts/format.sh
```

## License 🍻

This project is licensed under the terms of the MIT license.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fastapi-tag",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "FastAPI,Metadata,OpenAPI,Pydantic,RESTful",
    "author": "",
    "author_email": "Yasser Tahiri <hello@yezz.me>",
    "download_url": "https://files.pythonhosted.org/packages/64/8f/ca5575b5ad8afb7f1932c27540eb3dc12356ef467514e281ca3574722997/fastapi_tag-1.0.0.tar.gz",
    "platform": null,
    "description": "# FastAPI Tag\n\n<p align=\"center\">\n<a href=\"https://github.com/yezz123/fastapi-tag\" target=\"_blank\">\n    <img src=\"https://raw.githubusercontent.com/yezz123/fastapi-tag/main/.github/logo.png\" alt=\"FastAPI Tag\">\n</a>\n<p align=\"center\">\n    <em>Documented & Enhance the Metadata of your API \u2728</em>\n</p>\n<p align=\"center\">\n<a href=\"https://github.com/yezz123/fastapi-tag/actions/workflows/ci.yml\" target=\"_blank\">\n    <img src=\"https://github.com/yezz123/fastapi-tag/actions/workflows/ci.yml/badge.svg\" alt=\"Continuous Integration\">\n</a>\n<a href=\"https://pypi.org/project/fastapi-tag\" target=\"_blank\">\n    <img src=\"https://img.shields.io/pypi/v/pgqb?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n</a>\n<a href=\"https://codecov.io/gh/yezz123/fastapi-tag\">\n    <img src=\"https://codecov.io/gh/yezz123/fastapi-tag/branch/main/graph/badge.svg\"/>\n</a>\n</p>\n</p>\n\nA simple Package could be added to your FastAPI Project to enhance the metadata of your Project and documenting your API with more information.\n\n---\n\n**Source Code**: <https://github.com/yezz123/fastapi-tag>\n\n**Install the project**: `pip install fastapi-tag`\n\n---\n\n## Features \ud83c\udf89\n\n- Add a tag to your API, which can be used to filter the API documentation.\n- Add a description to your API, which can be used to describe the API.\n- Add a version to your API, which can be used to describe the version of the API and app.\n- Provide some others features like:\n  - `API_id`: A unique identifier for the API.\n  - `Audience`: The audience of the API (e.g. `public`, `internal`, `external`).\n- Tested in python 3.8 and up.\n- Last Version of FastAPI :rocket:\n\n## Usage \ud83d\udcda\n\n- To Identify the Metadata of your API:\n\n```py\nfrom fastapi import FastAPI\nfrom fastapi_tag.model import Contact, Metadata, Version\nfrom fastapi_tag.application import Application\n\napp = FastAPI()\n\ndef metadata(app):\n    return Metadata(\n        title=\"Hello World\",\n        version=Version(app=\"v0.1.1\", api=\"v0.1.0\"),\n        description=\"A simple example of a FastAPI application.\",\n        contact=Contact(\n            name=\"name\",\n            url=\"http://test.com\",\n            email=None\n        ),\n        api_id=\"49786b4b-1889-46ec-bd72-27f332436e6f\",\n        audience=\"company-internal\",\n    )\n\ndef app(metadata):\n    return Application(\"\", metadata)\n```\n\n- We have also `Problem` class thats depends on:\n  - `title`: The title of the problem.\n  - `status`: The status code of the problem.\n  - `detail`: A human-readable explanation specific to this occurrence of the problem.\n  - `instance`: A URI reference that identifies the specific occurrence of the problem.\n  - `type`: A URI reference that identifies the problem type.\n\n- `NameSpace` is a is a decorator that adds a route generator to the namespace object.\n\nfor example:\n\n```py\nfrom fastapi_tag.routers import Namespace\n\nroute = Namespace([])\n```\n\n## Development\n\n### Setup environment\n\nYou should create a virtual environment and activate it:\n\n> **Notes:** You need to have `python3.9` or higher installed.\n\nI Use `uv` to manage virtual environments, you can install it with:\n\n```bash\n# Install uv\npip install uv\n\n# Create a virtual environment\nuv venv\n\n# Activate the virtual environment\nsource .venv/bin/activate\n```\n\nAnd then install the development dependencies:\n\n```bash\n# Install dependencies\nuv pip install -e .[test,lint]\n```\n\n### Run tests \ud83c\udf1d\n\nYou can run all the tests with:\n\n```bash\nbash scripts/tests.sh\n```\n\n### Format the code \ud83c\udf42\n\nExecute the following command to apply `pre-commit` formatting:\n\n```bash\nbash scripts/format.sh\n```\n\n## License \ud83c\udf7b\n\nThis project is licensed under the terms of the MIT license.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Module for fastapi help to ensure the Metadata of the API",
    "version": "1.0.0",
    "project_urls": {
        "Funding": "https://github.com/sponsors/yezz123",
        "Homepage": "https://github.com/yezz123/fastapi-tag"
    },
    "split_keywords": [
        "fastapi",
        "metadata",
        "openapi",
        "pydantic",
        "restful"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f4f00e6872a043bd4c4e62de63afdf945ea3175c4cf871bb6f0c6143dab078c",
                "md5": "0010c070dbc02d607426c2eea99eb506",
                "sha256": "868058694c96772ffb4aacd881bac225eb1802ef753d362b6574bac3add43d73"
            },
            "downloads": -1,
            "filename": "fastapi_tag-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0010c070dbc02d607426c2eea99eb506",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8574,
            "upload_time": "2024-03-09T06:54:21",
            "upload_time_iso_8601": "2024-03-09T06:54:21.175952Z",
            "url": "https://files.pythonhosted.org/packages/1f/4f/00e6872a043bd4c4e62de63afdf945ea3175c4cf871bb6f0c6143dab078c/fastapi_tag-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "648fca5575b5ad8afb7f1932c27540eb3dc12356ef467514e281ca3574722997",
                "md5": "f33ab9a7fec63ce8a40299d56f39eda5",
                "sha256": "9355980e0e983eebeeb7037b85647a0c3ba5b5afe2b99b1234aca09c4f23ae7c"
            },
            "downloads": -1,
            "filename": "fastapi_tag-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f33ab9a7fec63ce8a40299d56f39eda5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 43826,
            "upload_time": "2024-03-09T06:54:23",
            "upload_time_iso_8601": "2024-03-09T06:54:23.341350Z",
            "url": "https://files.pythonhosted.org/packages/64/8f/ca5575b5ad8afb7f1932c27540eb3dc12356ef467514e281ca3574722997/fastapi_tag-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-09 06:54:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sponsors",
    "github_project": "yezz123",
    "github_not_found": true,
    "lcname": "fastapi-tag"
}
        
Elapsed time: 0.19883s