Connectors
In the following we provide the reference for all currently available connectors.
Amazon
You can install the Amazon connectors through the amazon
extra:
pip install stormware[amazon]
Note
All Amazon connectors use the AWS credentials that are obtained through the authentication mechanism described in the Amazon Web Services section of the authentication documentation.
AWS Secrets Manager
Facebook
You can install the Facebook connectors through the facebook
extra:
pip install stormware[facebook]
- class stormware.facebook.FacebookAds(account_name: str | None = None, secret_key: str = 'stormware-facebook', secret_store: SecretStore | None = None)
Facebook Ads connector.
- Parameters:
account_name – The name of the ad account to use.
secret_key – The key of the credentials in the secret store.
secret_store – The secret store to use for retrieving the credentials. Uses the default secret store when not provided.
Authentication
The session credentials are loaded from the secret store using the provided key. The secret must be a string-encoded JSON object with the
app_id
,app_secret
andaccess_token
keys. The app ID and app secret can be obtained by creating a Facebook App (under https://developers.facebook.com/apps/), after which we recommend creating a system user (under https://business.facebook.com/settings/system-users/), which can be then used to generate an access token. Note that the system user must have access to the necessary ad accounts and it must be also added to the appropriate app as an app tester.- report(*, metrics: list[str], dimensions: list[str] | None = None, statistics: list[str] | None = None, parameters: dict[str, Any] | None = None, account_name: str | None = None, account_id: str | None = None) DataFrame
Return a Facebook report.
- Parameters:
metrics – Numeric fields, see https://developers.facebook.com/docs/marketing-api/insights/parameters#fields.
dimensions – Dimensional fields, see https://developers.facebook.com/docs/marketing-api/insights/parameters#fields.
statistics – Ads action statistics fields, see https://developers.facebook.com/docs/marketing-api/reference/ads-action-stats/.
parameters – Report parameters, see https://developers.facebook.com/docs/marketing-api/insights/parameters#param.
account_name – The ad account name to use.
account_id – The ad account to use. Takes precedence over the
account_name
argument.
Google
You can install the Google connectors through the google
extra:
pip install stormware[google]
Note
All Google connectors use the Google credentials that are obtained through the authentication mechanism described in the Google Cloud Platform section of the authentication documentation.
Google BigQuery
- class stormware.google.bigquery.BigQuery(organization: str | None = None, project: str | None = None, auth: GCPAuth | None = None)
Google BigQuery connector.
Must be used with a context manager.
- Parameters:
organization – The organization to use.
project – The project to use.
auth – The Google Cloud Platform authentication manager to use.
Google Secret Manager
- class stormware.google.secrets.SecretManager(organization: str | None = None, project: str | None = None, auth: GCPAuth | None = None)
Google Cloud Secret Manager connector.
Must be used with a context manager.
- Parameters:
organization – The default organization to use.
project – The default project to use.
auth – The Google Cloud Platform authentication manager to use.
Google Sheets
- class stormware.google.sheets.Spreadsheet(key: str, organization: str | None = None, project: str | None = None, auth: GCPAuth | None = None)
Google Sheets connector.
Must be used with a context manager.
- Parameters:
key – The spreadsheet ID to use.
organization – The organization to use.
project – The project to use.
auth – The Google Cloud Platform authentication manager to use. Note that the credentials must be authorized for the
https://www.googleapis.com/auth/spreadsheets
scope.