Skip to main content

This SDK aims to provide customers with a range of features to simplify order management, dataset processing, and data acceptance.

Project description

Order Services

Our order management service offers a comprehensive set of APIs for querying orders and detailed information about the delivery batches under an order.

Dataset Services

Dataset services allow users to upload, download, and view datasets.

Data Acceptance Services

Data acceptance includes acceptance lists, details, and end-of-acceptance features, helping users ensure that their orders and datasets meet specific business standards and compliance requirements.

Prerequisites

  • Python 3.6+ (It is recommended to use Python 3.6 or higher)
  • pip (Python's package manager)

Installation

Install the customerService Python SDK using pip:

    pip install datatang-customer-service-x.x.x

Configuration

Before using the SDK, some basic configurations are required, including obtaining AppKey and AppSecret, and binding callback links.

Obtain AppKey and AppSecret

  1. Log in to the customer service system.
  2. Go to Personal Center - Application Credentials.
  3. Create a new key at "AppKey" and "AppSecret".

Configure the SDK

Configure the keys in the code:

from customerService.auth import Auth
auth = Auth(app_key='your-app-key', app_secret='your-app-secret')

Quick Start

Here is an example of how to use the Customer Service Python SDK for basic operations.

Initialize the Client

from customerService.auth import Auth
auth = Auth(app_key='your-app-key', app_secret='your-app-secret')

Query Datasets

from customerService.datasets import Datasets
from customerService.page_params import PageParams

dataset = Datasets(auth)
page = PageParams()
json = dataset.dataset_list(dataset_state='state', page=page)

Create a Dataset

from customerService.datasets import Datasets

dataset = Datasets(auth)
dataset.create_dataset(dataset_name='name', order_ids='orderId', storage_area='area')

Get a Dataset

from customerService.datasets import Datasets

dataset = Datasets(auth)
json = dataset.dataset_info(dataset_id='dataset_id')

Update a Dataset

from customerService.datasets import Datasets

dataset = Datasets(auth)
json = dataset.update_dataset(dataset_id='dataset_id', dataset_name='dataset_name', 
add_order_ids='add_order_ids', remove_order_ids='remove_order_ids')

Delete a Dataset

from customerService.datasets import Datasets

dataset = Datasets(auth)
json = dataset.delete_dataset(dataset_id='dataset_id')

Pagination Handling

from customerService.datasets import Datasets
from customerService.page_params import PageParams

dataset = Datasets(auth)
page = PageParams()
page.page_size = 10
page.page = 1
json = dataset.dataset_list(dataset_state='dataset_state', page=page)

DataSet Upload

from customerService.auth import Auth
from customerService.datasets import DatasetBatchs, Datasets
from customerService.upload import Upload

dataset = Datasets(auth)
dataset_id = dataset.create_dataset(dataset_name='upload_name' + 'dataset_name', 
order_ids='order_id', storage_area='storage_area')['responseObject']
batchs = DatasetBatchs(auth)
batch_id = batchs.create_dataset_batch(dataset_id=dataset_id, batch_name=batch_name, comment='')['responseList'][0]['batchId']
upload = Upload(auth=auth, dataset_id=dataset_id, batch_id=batch_id, file_path='your_file_path' ,region='your_storage_area', block_size = 100)
upload.execute()

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file datatang_customer_service-1.0.4-202604141155-py3-none-any.whl.

File metadata

File hashes

Hashes for datatang_customer_service-1.0.4-202604141155-py3-none-any.whl
Algorithm Hash digest
SHA256 f18b28e419b4a0b838582f19852a205545497b13f8bd6176f00686e0dceff934
MD5 d285be03e351e26a6d618eb113b5ce02
BLAKE2b-256 76b7e7d9489c58cf6a730b13600c5d6b0dd4d9c9a2d1ffa2e22c8b0104b503eb

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