The official LongMao SDK for Python.
Project description
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'])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for longmao-open-sdk-python-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25bf41dbc928029bbdd717f1c603a2362322e40d0579a1ba1fe3a647fa696812 |
|
MD5 | 6919383e1af348fb71a83fea150b54a3 |
|
BLAKE2-256 | 0d7b66fb0f06f81be09a34a29ccdaedacfaa5210e81afddbd234f1a7b7216350 |
Close
Hashes for longmao_open_sdk_python-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4172181b97444a1c67f481df85bcb4713178d3a117211d48c5e88c206ae777f |
|
MD5 | e9510a71a14f5df2b3c588f5052ea80f |
|
BLAKE2-256 | 9c443232ed01315059affd4a313f3a4858f1506f90ac7d6840fbe6102dbe3234 |