Microsoft Authentication Library (MSAL) for Python makes it easy to authenticate to Microsoft Entra ID. General docs are available here https://learn.microsoft.com/entra/msal/python/ Stable APIs are documented here https://msal-python.readthedocs.io. Questions can be asked on www.stackoverflow.com with tag "msal" + "python".
The link is currently broken due to missing parenthesis.
Notably, it links to an article that will now use the identity library, the MSAL wrapper, versus MSAL directly. Maybe that's okay?