A Circle Platform Services Python Client
Project description
Circle Platform Services - Python Client
WARNING: work in progress and subject to change
A python client and CLI for working with Circle Platform Services.
Installation
pip install cps-client
Usage
cps-client uses an enviroment variable to fetch your API key.
export CPS_API_KEY="<api-key>"
CLI
Installation provides a command line interface for interacting with CPS.
Usage: cps [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
configuration-get Get global CPS configuration
transfer-create-blockchain Create transfers from a wallet to blockchain...
transfer-get Get info about transfers.
transfers-get Get collection of transfers.
Library
You can also use cps-client as a library.
from cps_client import api
# you can get your own at https://my-sandbox.circle.com/
API_KEY="my-circle-sanbox-api-key"
source = api.WalletLocation(walletid)
destination = api.BlockchainLocation(address, chain)
amount = api.Money(amount, currency)
cpsAPI = api.Client("https://api-sandbox.circle.com", API_KEY)
transfer = cpsAPI.create_transfer(source, destination, amount)
print(transfer)
"""
Output:
{
"id": "b08478d5-a110-4b0e-9136-4b9d94601c65",
"source": {
"type": "wallet",
"id": "1000004286"
},
"destination": {
"type": "blockchain",
"address": "0x71715Da6ADa699e3a1a5C2664A55fF3D179c86EE",
"chain": "ETH"
},
"amount": {
"amount": "0.05",
"currency": "USD"
},
"status": "complete",
"transactionHash": "0x52176702740c8720d77ade3f20014396a4a2eb13d09dd1e6bffcc6f209a45326"
}
"""
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
cps_client-0.1.7.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file cps_client-0.1.7.tar.gz
.
File metadata
- Download URL: cps_client-0.1.7.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ec8a056907b52e2b0370d4b5d2192561f8c1e703b7fd257c9913177b17ceef7 |
|
MD5 | e59bcfdbb63b8904b53abef9ff9156b2 |
|
BLAKE2b-256 | 1cdbe31eab59a6736a4dc23f8b3c9b59aef7606b7e982fa0c454b5858cb8c3d4 |
File details
Details for the file cps_client-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: cps_client-0.1.7-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b53760e53e9fdc92499e30b0b8f759dc1a6e2c502f03ed64f5c27c2a9d4e97a6 |
|
MD5 | 75ba12e72a0103be96ac385dd2ec302b |
|
BLAKE2b-256 | 96059e9105d3f042a56cc3560830ac7a248e3e50c993a3c3e5b7f25029aa08ad |