pycraftco是一个python库,用作craft api的方便包装(https://api.craft.co/docs/v1)
pycraftco的Python项目详细描述
Pyraftco
pycraftco是一个python库,用作Craft API的方便包装。
安装
您可以通过pip
:
$ pip install pycraftco
使用量
下面的代码片段将检索facebook的名称和办公室。所有可用信息 请参考https://api.craft.co/docs/v1/reference/company.doc.html。但是,请注意 api文档中的所有字段都是camel大小写的,而lib中的所有字段都是camel大小写的 下划线分开。
frompycraftcoimportget_companyapi_key='qfNfdijpFhbhPhA7j2ZxvtEGkfv8DftTtmTEbnWN'# specify what data to load in the callbackdefcompany_query(company):company.display_name()company.locations.city()company.locations.hq()# You can use duns, name_constains or domain to search for companiesc=get_company(company_query,name_contains='Facebook',api_key=os.environ['API_KEY'])
代码使用了只允许访问facebook数据的测试密钥。请,参观 https://craft.co/business#business-form请求更多的许可密钥。
贡献
github上的https://github.com/craft-machine/pycraftco欢迎错误报告和请求拉取。
许可证
pip包在MIT License条款下作为开放源码提供。