使用 Python 中的 Cloud Talent Solution API 搜索职位

问题描述 投票:0回答:1

我找不到任何关于如何使用 Python 中的 Google Cloud Talent Solution API 来执行基本查询的有用文档。现在我正在努力:

from google.cloud import talent

credential_path = "creds_path/creds.json"
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = credential_path

client = talent.JobServiceClient()
client.job_query(query="python")

这给出了结果:

TypeError: search_jobs() got an unexpected keyword argument 'query'

删除

query
并尝试其他变量不起作用。我该如何使用这个API???

python google-cloud-platform google-cloud-talent-solution
1个回答
0
投票

这里是Cloud Talent Solution API的官方文档: https://cloud.google.com/talent-solution/job-search/v3/docs?hl=pt_BR

这是文档的示例:

def basic_keyword_search(client_service, company_name, keyword):
request_metadata = {
    "user_id": "HashedUserId",
    "session_id": "HashedSessionId",
    "domain": "www.google.com",
}
job_query = {"query": keyword}
if company_name is not None:
    job_query.update({"company_names": [company_name]})
request = {
    "search_mode": "JOB_SEARCH",
    "request_metadata": request_metadata,
    "job_query": job_query,
}

response = (
    client_service.projects().jobs().search(parent=parent, body=request).execute()
)
print(response)
© www.soinside.com 2019 - 2024. All rights reserved.