GSalary SDK for Python
Project description
GSalary SDK for Python 3.x
API Document:
Import
pip install gsalary_sdk
Prepare
Configure your appid, client-side private key, server-side public key and endpoint to the GSalary Client.
The endpoint shall not contain the context path.
from gsalary_sdk import GSalaryClient, GSalaryConfig
config = GSalaryConfig()
config.appid = 'aaaaaaa'
config.config_client_private_key_pem_file('/path/to/client_private_key.pem')
config.config_server_public_key_pem_file('/path/to/server_public_key.pem')
# or you can load pem directly
config.config_client_private_key_pem('-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----')
config.config_server_public_key_pem('-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----')
_cli = GSalaryClient(config)
Make A Request
POST request example
from gsalary_sdk import GSalaryRequest
path = "/v1/exchange/quotes"
request_body = dict(sell_currency='USD',
buy_currency='CNY',
sell_amount=0.1)
request = GSalaryRequest('POST', path, body=request_body)
resp = _cli.request(request)
GET request example
from gsalary_sdk import GSalaryRequest
path = "/v1/cards"
args = dict(create_start="2024-02-01T00:00:00+00:00",
create_end="2024-05-01T00:00:00+00:00",
page='1',
limit='20')
request = GSalaryRequest('GET', path, query_args=args)
resp = _cli.request(request)
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
gsalary_sdk-1.0.0.tar.gz
(7.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gsalary_sdk-1.0.0.tar.gz.
File metadata
- Download URL: gsalary_sdk-1.0.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30fbeaa537b8b7a951e2ddf6472c4ef3743fa70293cec5e88191d88b0e01cc4c
|
|
| MD5 |
ccd9051ad2cd18c39c607021bf40e1b1
|
|
| BLAKE2b-256 |
1e45948b4b59eafb483e340416ac340c596dcc46e1524e77cb40ae15bdeb5bef
|
File details
Details for the file gsalary_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: gsalary_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
428b937d8bee04edb9889c4d8bfa87dd151cb8f0ac0adeebfeabd5f34d78b2d7
|
|
| MD5 |
f59eaf81a3e1f8f9fad3ab6ad666ce2b
|
|
| BLAKE2b-256 |
9177c39211dd457caf984c66bcb4d3605d54e9bedbf42c1114725180426bd5c7
|