Her is an example for this https://docs.iterative.ai/PyDrive2/oauth/#authentication-with-a-service-account . Where:
service_config:
client_user_email: {{str}}
client_json_file_path: {{str}}
client_json_dict: {{dict}}
client_json: {{str}}
It means that service account credentials could be passed via dict, via file, via json string.
Other possible examples are in the thread below.
Related, but should be improved - googlearchive/PyDrive#157 . See auth tests for an example how we use service account by setting up a proper yaml file.