π» Generate Executable Code Examplesο
To run your method outside of the CCP UI, CCP can export ready-to-run scripts in different languages that use the CCP REST API to execute a method programmatically.
These scripts let you:
Reproduce the execution from your notebook, shell, or codebase
Automate executions and integrate CCP into pipelines
Understand how the platform works under the hood
π§ Where Can I Export the Code?ο
You can generate a full execution script from:
1. The Method Execution Formο
Before running a method, select a language and click the export icon
It will call CCPβs REST API to submit the method
It includes logic to poll for completion and download the results
2. The Execution Monitor Pageο
After a method has been executed:
Use the same language selector to generate the execution script
This version is pre-filled with the exact parameters used
You can rerun or adapt it with minimal effort
π§ͺ What the Script Doesο
The generated code performs the full execution lifecycle:
Authentication: using your API token
Submission: sends a POST request to
/methods/execute
Polling: waits for the job to finish (with backoff)
Result retrieval: downloads outputs and metadata
𧬠Supported Languagesο
Language | What You Get |
---|---|
Python 3 | Uses requests , JSON payloads, download files |
R | Uses httr , handles polling with loops |
Jupyter Python | Like Python, but includes visualization cells |
Julia 1.9.0 | Uses HTTP.jl , basic example |
Bash (curl) | Raw shell script with curl , polling logic |
Bash (wget) | Same as above, but using wget |
π Note: All scripts are self-contained and ready to run β just authebticate and go.
π¦ Whatβs in the Scriptο
A typical script contains:
method_id
β the ID of the method to runinput_values
β as JSON or inline in the bodypolling
logic β to wait for job completiondownload
logic β to save output files
You can copy, modify, and integrate these into your automation workflows.
π Security Noteο
The script will ask you to input your authentication password.
π§ Why It Mattersο
Exporting the execution script helps you:
Debug or rerun executions with full control
Reproduce your analysis in other environments
Integrate CCP into automated systems or pipelines
Learn how to interact with the REST API