This is a backward incompatible change to the way you use the pipedrive client, but I found it useful so I'm putting it up here for discussion.
Basically, I ended up writing a bunch of management code to get more than 100 things to handle pipedrive's pagination. Instead I really just wanted to write simple for loops over the results. So, I decided to change the wrapper into something that returned a python-style generator. The interface is quite nice for basic things, but if you rely on using response['additional_data'] then that is now obscured.
tldr, you can now do this:
pd = Pipedrive(PIPEDRIVE_API_TOKEN)
for person in pd.persons()
# each person object is a dict representing the data on that person
func(person)
This is a backward incompatible change to the way you use the pipedrive client, but I found it useful so I'm putting it up here for discussion.
Basically, I ended up writing a bunch of management code to get more than 100 things to handle pipedrive's pagination. Instead I really just wanted to write simple
for
loops over the results. So, I decided to change the wrapper into something that returned a python-style generator. The interface is quite nice for basic things, but if you rely on usingresponse['additional_data']
then that is now obscured.tldr, you can now do this: