GearPlug / pipedrive-python

Pipedrive wrapper written in Python
MIT License
50 stars 61 forks source link

Paging #8

Closed aaroneden closed 5 years ago

aaroneden commented 5 years ago

In looking at the Client.py code it doesn't appear this wrapper handles paging, right?

For example, if I use get_persons and PD sends back 1000 records I will only get the first 500.

I don't see any code that makes me think it would handle paging, but want to be 100% sure as I'm fairly new to Python. If I'm understanding correctly, I'll work to add paging as I'll need it for the script I'm putting together.

Thanks, Aaron

yagss commented 5 years ago

Hello aaroneden Take a look of this to know about pipedrive API pagination: https://pipedrive.readme.io/docs/core-api-concepts-responses https://pipedrive.readme.io/docs/core-api-concepts-pagination

aaroneden commented 5 years ago

Thanks Yordy — I understand how pipedrive handles pagination. My question was will the “pipedrive-python” wrapper properly handle pagination today?

yagss commented 5 years ago

Currently the wrapper does not handle pagination automatically, but many responses from de PD API contain the attr additional_data wich contains pagination information. It looks like this: persons = client.get_persons(start=0, limit=4, more_items_in_collection=True)

This will get a response from PD that will contain the additional_data that looks like this:

{'pagination': {'start': 0, 'limit': 4, 'more_items_in_collection': True, 'next_start': 4}}

This is a good staring point to add pagination support to the wrapper.

aaroneden commented 5 years ago

I’ll give it a shot, thanks!

DuckHawk123 commented 3 years ago

Did you get pagination to work?