safir.metadata.setup_metadata(*, package_name: str, app: aiohttp.web_app.Application, **kwargs: Any) → None

Add a metadata object to the application under the safir/metadata key.

  • pacakge_name (str) – The name of the package (Python namespace). This name is used to look up metadata about the package.

  • app (aiohttp.web.Application) – The application, which must already have a standard configuration object at the safir/config key. This function uses the name attribute of the configuration.

  • **kwargs – Add additional metadata keys, and their values, as keyword arguments. In practice, values must be JSON-serializable.


Metadata sources

setup_metadata integrates extensively with your package’s metadata. Typically this metadata is either set in the setup.cfg or file (for setuptools-based applications):


Used as the version metadata. This may be set automatically with setuptools_scm.


Use as the description metadata.


Used as the documentation_url metadata.

project_urls, Source code

Used as the respository_url.

The configuration object (app["safir/config"]) also provides metadata:

Used as the name metadata field.

Metadata schema

The metadata is stored as a dict in the "safir/metadata" key of the application:

  "name": "safirdemo",
  "version": "0.1.0",
  "description": "Demonstration of a Safir-based app.",
  "repository_url": "",
  "documentation_url": ""