get_metadata¶
- safir.metadata.get_metadata(*, package_name: str, application_name: str) Metadata¶
Retrieve metadata for the application.
- Parameters:
- Returns:
metadata – The package metadata as a Pydantic model, suitable for returning as the result of a FastAPI route.
- Return type:
Notes
get_metadataintegrates extensively with your package’s metadata. Typically this metadata is set inpyproject.toml,setup.cfg,setup.pyfile (for setuptools-based applications). Thepyproject.tomlfields used are:- version
Used as the version metadata. This may be set automatically with
setuptools_scm.- description
Use as the
descriptionmetadata.- project.urls, Homepage
Used as the
documentation_urlmetadata.- project.urls, Source
Used as the
respository_url.
Packages using
setup.cfgorsetup.pyget the last three items of metadata from different sources:- summary
Use as the
descriptionmetadata.- url
Used as the
documentation_urlmetadata.- project_urls, Source code
Used as the
respository_url.