Skip to content

Installation

FastOpenAPI is available on PyPI and supports Python 3.10 and above.

Requirements

  • Python 3.10+ - Required for modern type hints and Pydantic v2 support
  • Pydantic v2 - Automatically installed as a dependency
  • (Optional) A web framework - Install separately or use extras

Basic Installation

Install FastOpenAPI using pip:

pip install fastopenapi

This installs the core library with Pydantic v2. You'll need to install your web framework separately if you don't have it already.

Installation with Framework Extras

To install FastOpenAPI along with a specific framework, use one of the following extras:

AIOHTTP

pip install fastopenapi[aiohttp]

Installs FastOpenAPI with aiohttp.

Django

pip install fastopenapi[django]

Installs FastOpenAPI with Django.

Falcon

pip install fastopenapi[falcon]

Installs FastOpenAPI with Falcon (ASGI/WSGI support).

Flask

pip install fastopenapi[flask]

Installs FastOpenAPI with Flask.

Quart

pip install fastopenapi[quart]

Installs FastOpenAPI with Quart (async Flask alternative).

Sanic

pip install fastopenapi[sanic]

Installs FastOpenAPI with Sanic.

Starlette

pip install fastopenapi[starlette]

Installs FastOpenAPI with Starlette.

Tornado

pip install fastopenapi[tornado]

Installs FastOpenAPI with Tornado.

Installing Multiple Frameworks

If you need to work with multiple frameworks (e.g., for testing or library development), you can install multiple extras:

pip install fastopenapi[flask,starlette,django]

Development Installation

To contribute to FastOpenAPI or run tests, clone the repository and install in development mode:

git clone https://github.com/mr-fatalyst/fastopenapi.git
cd fastopenapi
poetry install --all-extras

This installs FastOpenAPI with all development dependencies and framework extras.

Verifying Installation

After installation, verify that FastOpenAPI is correctly installed:

import fastopenapi
print(fastopenapi.__version__)

You should see the version number (e.g., 1.0.0rc1).

Upgrading

To upgrade FastOpenAPI to the latest version:

pip install --upgrade fastopenapi

To upgrade with extras:

pip install --upgrade fastopenapi[flask]

Troubleshooting

ImportError for a specific framework

If you get an ImportError when trying to use a specific router:

from fastopenapi.routers import FlaskRouter
# ImportError: This framework is not installed.

Solution: Install the framework extra:

pip install fastopenapi[flask]

Or install the framework separately:

pip install flask

Pydantic v1 vs v2

FastOpenAPI requires Pydantic v2. If you have Pydantic v1 installed, you may encounter compatibility issues.

Check your Pydantic version:

pip show pydantic

Upgrade to Pydantic v2:

pip install --upgrade "pydantic>=2.0"

Python Version Issues

FastOpenAPI requires Python 3.10 or higher. Check your Python version:

python --version

If you have an older version, consider using pyenv to manage multiple Python versions.

Next Steps

Now that FastOpenAPI is installed, continue to: