2016-07-06 26 views
0

我正在嘗試使用Sovren Resume Parser API,並且我非常喜歡API。我的應用程序在Django-Python中,因此我想實現調用並使用Python腳本接收此API。Sovren Resume Parser - Python

文檔 - http://resumeparsing.com/

我需要如何去了解這個概述。

+0

沒有python api? –

+0

顯然不是。只有API文檔,但我相信我們需要構建一個Python解析客戶端。 –

+0

如果我稍後有機會,我會一起扔python解決方案 –

回答

1
from zeep import Client 

client = Client('http://services.resumeparsing.com/ResumeService.asmx?wsdl') 

response = client.service.GetAccountInfo(request={'AccountId': 'AccountId','ServiceKey':'ServiceKey'}) 
print(response) 

使用Zeep模塊取得了訣竅!這也適用於Python3!

0

我在Python中使用以下代碼來解析作業順序和恢復。

我無法弄清楚的一件事是壓縮/壓縮請求數據。 zlib.compress()或gzip.compress()的輸出不起作用。 Web服務抱怨數據轉換失敗。

from zeep import Client 
import os 

#If required, set proxy. 
#os.environ["http_proxy"] = 'http://user:[email protected]:port' 
#os.environ["https_proxy"] = 'https://user:[email protected]:port' 

account_id = 'account_id' 
service_key = 'service_key' 

client = Client('http://services.resumeparsing.com/ParsingService.asmx?wsdl') 

with open('C:/temp/jd.docx', 'rb') as in_file: 
    file_bytes = in_file.read() 

request = {'AccountId':account_id, 'ServiceKey':service_key, 'FileBytes':file_bytes} 

response = client.service.ParseJobOrder(request) 
# Similarlly ParseResume() for parsing resume. 

print('response.Code = ', response.Code) 
print('response.SubCode = ', response.SubCode) 
print('response.Message = ', response.Message) 
print('response.Xml = ', response.Xml)