Patreon Python APIv2

Trying to call get_identity() using the patreon-python and I keep getting an error.

AttributeError: 'API' object has no attribute 'get_identity'

The code (directly from the github readme)
api_client = patreon.API(patron_access_token)
patron_response = api_client.get_identity(None, {‘membership’: patreon.schemas.member.Attributes.currently_entitled_amount_cents})

Any feedback on how I can retrieve some of this information for the APIv2?

Python lib may not be up to date. You can cross-check the calls and endpoints from PHP lib:

The python github is out of date. Many of the functions have changed (for example - get_campaign() changed to fetch_campaign(). To investigate further, I would use the dir() function to see what properties the API object has:

api_client = patreon.API(access_token)

which returns:

[… ‘access_token’, ‘extract_cursor’, ‘fetch_campaign’, ‘fetch_campaign_and_patrons’, ‘fetch_page_of_pledges’, ‘fetch_user’]

1 Like