get_metadata

safir.metadata.get_metadata(*, package_name: str, application_name: str) safir.metadata.Metadata

Retrieve metadata for the application.

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

  • application_name (str) – The value to return as the application name (the name metadata field).

Returns

metadata – The package metadata as a Pydantic model, suitable for returning as the result of a FastAPI route.

Return type

Metadata

Notes

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

version

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

summary

Use as the description metadata.

url

Used as the documentation_url metadata.

project_urls, Source code

Used as the respository_url.