rhino_health#

Entry point to using the Rhino Health Python SDK.

Subpackages#

Package Contents#

Functions#

login(→ lib.rhino_session.RhinoSession)

Login to the Rhino platform and get a RhinoSession to interact with the rest of the system.

rhino_health.login(username: str | None = None, password: str | None = None, otp_code: str | None = None, rhino_api_url: str = ApiEnvironment.PROD_API_URL, sdk_version: str = SDKVersion.PREVIEW, show_traceback: bool = False, authentication_details: lib.rest_api.rhino_authenticator.AuthenticationDetailType | None = None) lib.rhino_session.RhinoSession#

Login to the Rhino platform and get a RhinoSession to interact with the rest of the system.

Parameters:
username: Optional[str]

The email you are logging in with if logging in with username/password. You must login with either username/password or authentication_details

password: Optional[str]

The password you are logging in with if logging in with username/password You must login with either username/password or authentication_details

authentication_details: Optional[AuthenticationDetailType]

Dictionary of authentication information you are logging in with if not using username/password. Refer to Examples and See Also section

otp_code: Optional[str]

If 2FA is enabled for the account, the One Time Password code from your 2FA device

rhino_api_url: str

Which rhino environent you are working in.

sdk_version: str

Used internally for future backwards compatibility. Use the default

show_traceback: bool

Should traceback information be included if an error occurs

Returns:
session: RhinoSession

A session object to interact with the cloud API

See also

rhino_health.lib.constants.ApiEnvironment

List of supported environments

rhino_health.lib.rhino_session.RhinoSession

Session object with accessible endpoints

rhino_health.lib.rest_api.rhino_authenticator.AuthenticationDetailType

Authentication detail dictionary for login

Examples

>>> import rhino_health
>>> my_username = "user@example.com"  # Replace me
>>> my_password = "Correct horse battery staple"  # Replace me (see https://xkcd.com/936/)
>>> session = rhino_health.login(username=my_username, password=my_password, otp_code=otp_code)
RhinoSession()
>>> import rhino_health
>>> session = rhino_health.login(authentication_details={"sso_access_token": "MyAccessToken", "sso_provider": "google", "sso_client": "my_hospital"})
RhinoSession()