| description | The Code Ocean Python SDK makes it even easier to leverage the full functionality of the extensive Code Ocean Public API in your Python scripts and applications. | ||
|---|---|---|---|
| metaLinks |
|
{% hint style="info" %} The Python SDK requires Python >=3.11 and Code Ocean >=2.19 {% endhint %}
The SDK can be installed via pip as shown below:
pip install -U codeoceanFor development, install from source with:
pip install -e .[dev] -When creating a CodeOcean client as shown below, you will use your Code Ocean API token. The Python library will then automatically send this key in each request. You can learn more about creating a Code Ocean API Token in our guide here.
from codeocean import CodeOcean
client = CodeOcean(domain="https://{domain}", token="cop_d23dasd312")The Capsule, Computation, and Data Asset sections of the Code Ocean API Guide all contain examples using the Python SDK.