Skip to main content

JD Official SDK

Project description

python3 SDK

1. dependencies

  • rsa
  • psutil
  • apscheduler
  • wincertstore (when SKD is using in windows environment)

2. how to use

(1) use API

The code fragment shows the basic use of an API, the main steps are first init an api, and second to get the result

import jd.api
import json

jd.setDefaultAppInfo("your appKey", "your appSecret") # only need to init one time
# get a api you need to use
a = jd.api.AreaProvinceGetRequest('the domain this SDK will send request to', 80)
a.param = 'a'
f = a.getResponse("your access_token")
print(json.dumps(f, ensure_ascii=False))

The Example show a simple use of the SDK, in python, we just declare the fist level vars of xxxRequesst, so for some complex structures, we didn't specify for you, you can constuct the field with json by you self, then then use xxxRequesst.xxx = json to set the request param.

(2) security

from jd.security.tde_client.tde_client import TdeClientCache, TdeClient
tcc = TdeClientCache()
ins = tcc.instance("the domain this SDK will send request to", "access_token", "app_key", "app_secret")
# encryption
ciphertext = ins.encrypt_string('16612341234')
print(ciphertext)
# judge if the text is encrypted
if TdeClient.is_encrypt_data(ciphertext):
    # decryption
    print(ins.decrypt_string(ciphertext))

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

jd-sdk-1.1.1.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

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

jd_sdk-1.1.1-py3-none-any.whl (69.0 kB view details)

Uploaded Python 3

File details

Details for the file jd-sdk-1.1.1.tar.gz.

File metadata

  • Download URL: jd-sdk-1.1.1.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for jd-sdk-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f4742e2f0b8b0b2e6fcc94d7209482e33503675a62bf931291deff6e45f72bf0
MD5 65ea7fdb2dfdfbd591a2850944079faf
BLAKE2b-256 349709cdf54a55fe8664771d6068a9927c9cbcb5ae5a48d5dff756d8049f974a

See more details on using hashes here.

File details

Details for the file jd_sdk-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: jd_sdk-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 69.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for jd_sdk-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 611f86c444654bc6f3e04747a5c5e8cbf1176deb39013a06995575f8632115df
MD5 ee4398ed1a377f99c75c42be82f5cd4d
BLAKE2b-256 80fdb384b9bc28c2b266a826bb7e2c6d56a819f43cf9754f5633bcb5df092940

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