预测总部事件情报
predicthq的Python项目详细描述
注意
有关最新的来源、讨论、错误报告等,请访问GitHub repository
python的predicthq api客户端
PredictHQ是一家需求情报公司,它将现实世界中的事件整合成一个全球性的真相来源,帮助企业更好地了解需求并为未来规划。
安装
pip install predicthq
使用量
frompredicthqimportClientphq=Client(access_token="$ACCESS_TOKEN")# the search() method returns an EventResultSet which allows you to iterate over the 1st page of itemsforeventinphq.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() generatorforeventinphq.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 itemsforeventinphq.events.search(q="matisse",country="FR",offset=10,limit=5):print(event.rank,event.category,event.title,event.start.strftime('%Y-%m-%d'))
终点
- Client.oauth2
- Client.accounts
- Client.events
- Client.signals
- Client.places
有关所有可用终结点的描述,请参阅我们的API Documentation。
运行测试
pip install tox tox