-
Notifications
You must be signed in to change notification settings - Fork 28
Getting Started
To import the library, just run
import ally
Then, we can create an an API object a couple different ways:
It's strongly recommended that the API keys be stored as environment variables. If the account variables are specified as recommended, instantiation is easy:
a = ally.Ally()
And you're done!
However, variables can be passed in on instantiation. This way, no account variables need to be set. Keep in mind that this is much less secure for distributable applications, since anyone with these keys will have access to the account with which they're associated.
params = {
'resource_owner_secret':XXXX,
'resource_owner_key':XXXX,
'client_secret':XXXX,
'client_key':XXXX
}
a = ally.Ally(params)
Parameters can also be read from a JSON file:
params.json
{
'resource_owner_secret':XXXX,
'resource_owner_key':XXXX,
'client_secret':XXXX,
'client_key':XXXX
}
The object allows account numbers to be specified at each relevant function call, or to be specified as a permanent parameter like the API keys. If the account number isn't specified as an environment variable:
params = {
... # see above
'account' : 12345678
}
a = ally.Ally(params)
Now you're ready to make API calls with your new object.