Skip to main content

The official LongMao SDK for Python.

Project description

longmao-open-sdk-python

The official LongMao SDK for Python.

访问龙猫数据开放平台的官方SDK。

Links

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

longmao-open-sdk-python-0.1.6.tar.gz (13.2 kB view details)

Uploaded Source

File details

Details for the file longmao-open-sdk-python-0.1.6.tar.gz.

File metadata

  • Download URL: longmao-open-sdk-python-0.1.6.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for longmao-open-sdk-python-0.1.6.tar.gz
Algorithm Hash digest
SHA256 0e5bee1e9d80594af5bdb21c53a7436bfdaf5649b178a13ebd4faf2c211427ed
MD5 63a13b2e87d55a97391de85104c10a37
BLAKE2b-256 ead27b5783d2088a9df85b68a59d21a67463c02a4824d7b53904ace970fd4d33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page