For openSUSE Tumbleweed run the following as root:
zypper addrepo https://download.opensuse.org/repositories/home:alarrosa:branches:devel:languages:python/openSUSE_Tumbleweed/home:alarrosa:branches:devel:languages:python.repo
zypper refresh
zypper install python-fastapi
For openSUSE Factory run the following as root:
zypper addrepo https://download.opensuse.org/repositories/home:alarrosa:branches:devel:languages:python/openSUSE_Factory/home:alarrosa:branches:devel:languages:python.repo
zypper refresh
zypper install python-fastapi
For 15.6 run the following as root:
zypper addrepo https://download.opensuse.org/repositories/home:alarrosa:branches:devel:languages:python/15.6/home:alarrosa:branches:devel:languages:python.repo
zypper refresh
zypper install python-fastapi