TiTiler Extensions

raw JSON →
2.0.2 verified Fri May 01 auth: no python

Extensions for TiTiler Factories providing additional endpoints such as rendering, Terrain RGB, and STAC tile support. Current version is 2.0.2, compatible with Python >=3.11. Release cadence is irregular, with major version bumps aligned with rio-tiler updates.

pip install titiler.extensions
error AttributeError: module 'titiler' has no attribute 'extensions'
cause Installing the wrong package: using 'pip install titiler' instead of 'pip install titiler.extensions'.
fix
Install titiler-extensions: pip install titiler.extensions
error ImportError: cannot import name 'RenderExtension' from 'titiler.extensions'
cause Using an outdated version of titiler-extensions (<0.0.1) or having a conflicting namespace package.
fix
Upgrade titiler-extensions: pip install --upgrade titiler.extensions
error TypeError: register_extension() missing 1 required positional argument: 'extension'
cause Calling register_extension() without passing an extension instance; this method is not a decorator.
fix
Use tiler.register_extension(RenderExtension())
breaking Version 2.0.0 dropped support for Python <3.11 and introduced breaking changes in extension registration. The extension classes now require explicit registration via the TilerFactory.register_extension() method, not as a subclass.
fix Update code to use tiler.register_extension(MyExtension()) instead of subclassing the factory.
breaking In version 2.0.0, the 'assets' parameter became required in tile endpoints for extensions that rely on asset selection. Using the special value ':all:' is no longer sufficient for all cases.
fix Explicitly specify asset names in requests or configure defaults in the extension.
deprecated The 'titiler.extensions.render' submodule is deprecated. Use 'titiler.extensions.RenderExtension' directly as a class.
fix Replace 'from titiler.extensions.render import RenderExtension' with 'from titiler.extensions import RenderExtension'.

Create a FastAPI app with a TiTiler TilerFactory and register the RenderExtension.

from fastapi import FastAPI
from titiler.core.factory import TilerFactory
from titiler.extensions import RenderExtension

app = FastAPI()
tiler = TilerFactory()
tiler.register_extension(RenderExtension())
app.include_router(tiler.router)