Skip to content

Latest commit

 

History

History
64 lines (40 loc) · 1.51 KB

config.rst

File metadata and controls

64 lines (40 loc) · 1.51 KB

Config File

An example config file is provided in this repository, it supports multiple accounts. The program looks for a file called credentials.yml

The config is parsed by confused, see their docs for more in depth information. Search paths are:

macOS: ~/.config/python-sp-api
Other Unix: ~/.config/python-sp-api
Windows: %APPDATA%\python-sp-api where the APPDATA environment variable falls back to %HOME%\AppData\Roaming if undefined

If you're only using one account, place it under default. You can pass the account's name to the client to use any other account used in the credentials.yml file.

version: '1.0'

default:
  refresh_token: ''
  client_id: ''
  client_secret: ''
  profile_id: ''

another_account:
  refresh_token: ''
  client_id: ''
  client_secret: ''
  profile_id: ''

Usage with default account

Campaigns().list_campaigns()

Usage with another_account

You can use every account's name from the config file for account

Campaigns(account="another_account", marketplace=Marketplaces.ES).list_campaigns()

References