Python SDK for Commercetools
This is an unofficial Python SDK for the Commercetools platform. It only supports Python 3.6+ and uses type annotation for an improved development experience.
The API is mostly generated using the commercetools api RAML file and uses the attr library for the dataobjects and marshmallow for the serialization and deserialization steps.
Installation
pip install commercetools
Example
from commercetools import Client
client = Client(
project_key="<your-project-key>",
client_id="<your-client-id>",
client_secret="<your-client-secret>",
scope=["<scopes>"],
url="https://api.sphere.io",
token_url="https://auth.sphere.io/oauth/token",
)
product = client.products.get_by_id("00633d11-c5bb-434e-b132-73f7e130b4e3")
print(product)
The client can also be configured by setting the following environment variables:
export CTP_PROJECT_KEY="<project key>"
export CTP_CLIENT_SECRET="<client secret>"
export CTP_CLIENT_ID="<client id>"
export CTP_AUTH_URL="https://auth.sphere.io"
export CTP_API_URL="https://api.sphere.io"
export CTP_SCOPES="<comma seperated list of scopes>"
And then constructing a client without arguments:
from commercetools import Client
client = Client()
product = client.products.get_by_id("00633d11-c5bb-434e-b132-73f7e130b4e3")
print(product)
Metadata
Release files for commercetools-ratdev 1.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| commercetools-ratdev-1.5.1.tar.gz | 161.4 kB | Without provenance | Details for commercetools-ratdev-1.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| commercetools_ratdev-1.5.1-py3-none-any.whl | Python 3 | none | any | Details for commercetools_ratdev-1.5.1-py3-none-any.whl |
Total release size: 339.0 kB
Release files / commercetools-ratdev-1.5.1.tar.gz
| Download URL | commercetools-ratdev-1.5.1.tar.gz |
|---|---|
| Size | 161.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8c8ac1ba504d190552bab0c51388c7d6481c7acf7dfd77e95c4e5b73b4d2687
|
|
BLAKE2b-256 checksum How to use checksums |
13ebaa46392bd6a4efa0263e8533db8492ecda90f00bcffb833161c080fb10a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|
Release files / commercetools_ratdev-1.5.1-py3-none-any.whl
| Download URL | commercetools_ratdev-1.5.1-py3-none-any.whl |
|---|---|
| Size | 177.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
acf48ec73cc8e8cd869c1884c381ec0de9bb6ecd7f3e5798fe6edd79f663777f
|
|
BLAKE2b-256 checksum How to use checksums |
c005df01ecae6927c2bf9a607bc3b86dc6cf8aff9f843ace2f25fe0410d91a54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|
Security for commercetools-ratdev 1.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.