Skip to content

Commit

Permalink
Merge 14819bc into 5cee7c2
Browse files Browse the repository at this point in the history
  • Loading branch information
mbonnefoy committed Dec 12, 2018
2 parents 5cee7c2 + 14819bc commit a63dfb0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.rst
Expand Up @@ -30,8 +30,18 @@ Usage
phq = Client(access_token="$ACCESS_TOKEN")
# the search() method returns an EventResultSet which allows you to iterate over the 1st page of items
for event in phq.events.search(q="Foo Fighters", rank_level=[4, 5], place={"scope": ["5391959", "5368361"]}):
print(event.rank, event.category, event.title, event.start.strftime('%Y-%m-%d'))
# if you want to iterate over all the results for your query, you can chain the iter_all() generator
for event in phq.events.search(q="matisse", country="FR").iter_all():
print(event.rank, event.category, event.title, event.start.strftime('%Y-%m-%d'))
# you can skip results with the offset parameter and limit the number of results with the limit parameter
# the following skips the first 10 results and limits the results to 5 items
for event in phq.events.search(q="matisse", country="FR", offset=10, limit=5):
print(event.rank, event.category, event.title, event.start.strftime('%Y-%m-%d'))
Endpoints
#########
Expand Down

0 comments on commit a63dfb0

Please sign in to comment.