longmao-open-sdk-python
==================
The official LongMao SDK for Python.
访问龙猫数据开放平台的官方SDK。
Links
-----
* Website: https://www.longmaosoft.com
Example
----------------
.. code-block:: python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import traceback
from longmao.api.project.ApiProjectTaskCreate import ApiProjectTaskCreate
from longmao.core.DefaultLongMaoClient import DefaultLongMaoClient
from longmao.core.LongMaoClientConfig import LongMaoClientConfig
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s %(levelname)s %(message)s',
filemode='a',)
logger = logging.getLogger('')
if __name__ == '__main__':
"""
设置配置。
"""
longmao_client_config = LongMaoClientConfig()
longmao_client_config.access_key_id = '58bf489978ed44c49a4b9c64e96d9d6f'
longmao_client_config.access_key_secret = 'bacb00c2e0200ccd7e997b53c9efb62d795b70e9'
"""
得到客户端对象。
"""
client = DefaultLongMaoClient(longmao_client_config, logger)
"""
系统接口示例:批量添加任务
"""
# 对照接口文档,构造请求对象
api = ApiProjectTaskCreate()
api.project_id = 'd36ec84f-ea18-4d1d-ae33-33bbad816f11'
api.file = {'file': open('/longmao/data/demo.csv', 'rb')}
result = None
try:
result = client.execute(api)
except Exception as e:
print(traceback.format_exc())
if not result:
print("failed execute")
else:
if result['code'] == '200':
# 成功
print("get response job_id:" + result['object']['job_id'])
else:
# 失败
print(result['code'] + "," + result['message'])
Raw data
{
"_id": null,
"home_page": "https://github.com/nayuan/longmao-open-sdk-python",
"name": "longmao-open-sdk-python",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "longmao,open,sdk",
"author": "nayuan",
"author_email": "haojunsheng@longmaosoft.com",
"download_url": "https://files.pythonhosted.org/packages/ea/d2/7b5783d2088a9df85b68a59d21a67463c02a4824d7b53904ace970fd4d33/longmao-open-sdk-python-0.1.6.tar.gz",
"platform": "any",
"description": "longmao-open-sdk-python\n==================\n\nThe official LongMao SDK for Python.\n\n\u8bbf\u95ee\u9f99\u732b\u6570\u636e\u5f00\u653e\u5e73\u53f0\u7684\u5b98\u65b9SDK\u3002\n\n\nLinks\n-----\n\n* Website: https://www.longmaosoft.com\n\n\nExample\n----------------\n\n.. code-block:: python\n\n #!/usr/bin/env python\n # -*- coding: utf-8 -*-\n import logging\n import traceback\n\n from longmao.api.project.ApiProjectTaskCreate import ApiProjectTaskCreate\n from longmao.core.DefaultLongMaoClient import DefaultLongMaoClient\n from longmao.core.LongMaoClientConfig import LongMaoClientConfig\n\n logging.basicConfig(\n level=logging.INFO,\n format='%(asctime)s %(levelname)s %(message)s',\n filemode='a',)\n logger = logging.getLogger('')\n\n\n if __name__ == '__main__':\n \"\"\"\n \u8bbe\u7f6e\u914d\u7f6e\u3002\n \"\"\"\n longmao_client_config = LongMaoClientConfig()\n longmao_client_config.access_key_id = '58bf489978ed44c49a4b9c64e96d9d6f'\n longmao_client_config.access_key_secret = 'bacb00c2e0200ccd7e997b53c9efb62d795b70e9'\n\n \"\"\"\n \u5f97\u5230\u5ba2\u6237\u7aef\u5bf9\u8c61\u3002\n \"\"\"\n client = DefaultLongMaoClient(longmao_client_config, logger)\n\n \"\"\"\n \u7cfb\u7edf\u63a5\u53e3\u793a\u4f8b\uff1a\u6279\u91cf\u6dfb\u52a0\u4efb\u52a1\n \"\"\"\n # \u5bf9\u7167\u63a5\u53e3\u6587\u6863\uff0c\u6784\u9020\u8bf7\u6c42\u5bf9\u8c61\n api = ApiProjectTaskCreate()\n api.project_id = 'd36ec84f-ea18-4d1d-ae33-33bbad816f11'\n api.file = {'file': open('/longmao/data/demo.csv', 'rb')}\n\n result = None\n try:\n result = client.execute(api)\n except Exception as e:\n print(traceback.format_exc())\n if not result:\n print(\"failed execute\")\n else:\n if result['code'] == '200':\n # \u6210\u529f\n print(\"get response job_id:\" + result['object']['job_id'])\n else:\n # \u5931\u8d25\n print(result['code'] + \",\" + result['message'])\n\n\n",
"bugtrack_url": null,
"license": "Apache",
"summary": "The official LongMao SDK for Python.",
"version": "0.1.6",
"project_urls": {
"Homepage": "https://github.com/nayuan/longmao-open-sdk-python"
},
"split_keywords": [
"longmao",
"open",
"sdk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ead27b5783d2088a9df85b68a59d21a67463c02a4824d7b53904ace970fd4d33",
"md5": "63a13b2e87d55a97391de85104c10a37",
"sha256": "0e5bee1e9d80594af5bdb21c53a7436bfdaf5649b178a13ebd4faf2c211427ed"
},
"downloads": -1,
"filename": "longmao-open-sdk-python-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "63a13b2e87d55a97391de85104c10a37",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13172,
"upload_time": "2023-07-14T11:49:26",
"upload_time_iso_8601": "2023-07-14T11:49:26.643083Z",
"url": "https://files.pythonhosted.org/packages/ea/d2/7b5783d2088a9df85b68a59d21a67463c02a4824d7b53904ace970fd4d33/longmao-open-sdk-python-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-14 11:49:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nayuan",
"github_project": "longmao-open-sdk-python",
"github_not_found": true,
"lcname": "longmao-open-sdk-python"
}