Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python,pipedrive_Python_Pipedrive Api - Fatal编程技术网

Python,pipedrive

Python,pipedrive,python,pipedrive-api,Python,Pipedrive Api,我的第一个节目是在hello world之后,哈哈 我已经设法将以下内容拼凑在一起,并且它符合我当前的目的。但是它确实非常非常慢 我认为这是因为程序正在查看每一笔交易,并根据交易id检查每一条记录 答案可能是搜索交易,只返回数据。如何更改代码以进行此类搜索(即,搜索交易ID),然后只返回该数据 很抱歉问了这么一个令人尴尬的天真问题 from pypedriver import Client pipedrive = Client('Pipedrive_API_key') print('enter

我的第一个节目是在hello world之后,哈哈

我已经设法将以下内容拼凑在一起,并且它符合我当前的目的。但是它确实非常非常慢

我认为这是因为程序正在查看每一笔交易,并根据交易id检查每一条记录

答案可能是搜索交易,只返回数据。如何更改代码以进行此类搜索(即,搜索交易ID),然后只返回该数据

很抱歉问了这么一个令人尴尬的天真问题

from pypedriver import Client
pipedrive = Client('Pipedrive_API_key')
print('enter deal id')
input_deal_id = input()
print('deal id is set to ' + input_deal_id )
deals = pipedrive.Deal.fetch_all()
for deal in deals:
    if str(deal.id) == str(input_deal_id):
        print(deal.title, deal.id, deal.value, deal.currency)

减速可能不是检查所有内容,而是使用
pipedrive.Deal.fetch_all()
下载所有内容。如果您可以执行类似于
pipedrive.Deal.fetch\u by\u id(input\u Deal\u id)
的操作,您只需下载所需的信息,这会更好。底层API允许通过其id请求单个交易;您可能希望尝试使用类似于
请求的东西来直接使用它,或者使用另一个支持此类调用的模块(例如python pipedrive)。