Set Up Data Custom Code SDK (Beta)
Data Custom Code SDK is a toolkit that you can use to develop and test custom Python scripts locally and then deploy them to Data 360 for execution. The SDK provides dedicated libraries, a command-line interface (CLI), and optimized workflows that ensure a secure and productive development experience.
The SDK uses OAuth and an external client app to connect to your Data 360 instance from your local machine. With this connection, you can read Data 360 objects directly for local testing, giving you the opportunity to catch errors early and verify your code.
Code extension is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Beta Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer's sole discretion.
| Edition Table |
|---|
| Available in: Developer, Enterprise, Performance, and Unlimited Editions. See Data 360 edition availability. |
| Permission Sets Needed | |
|---|---|
| To set up the SDK: | Permission set:
|
Install this software on your local machine.
- Operating System: macOS or Linux
- Python 3.11: We recommend using
pyenvto install Python 3.11 - Azul Zulu OpenJDK 17.x
- Docker Desktop
- Access a Data 360 sandbox with appropriate permission sets. If you don't have a sandbox, create one. See Create a Data 360 Sandbox.
- Set up an external client app and obtain the required authentication values. See Set Up an External Client App for Data Custom Code SDK.
You need these values for SDK set up.
login_url: Data 360 Sandbox login URLclient_id: Consumer Key of your external client appclient_secret: Consumer Secret of your external client apprefresh_token: The refresh token obtained from the OAuth flowcore_token(optional): The access token (also called core token)
-
Create a project directory and navigate to it.
<project_dir>: The name of your project directory
-
Create and activate a Python virtual environment.
<venv_dir>: Name of your virtual environment directory (commonly.venv)
-
Install the SDK package from PyPI with pip.
Your local environment now has:
- The SDK and all its dependencies installed in your Python environment
- Access to the
datacustomcodecommand-line tool for scanning, running, and deploying custom code- All necessary Python modules available for import in your scripts
-
Verify the SDK installation.
If the command returns a version number, the SDK is installed correctly.
-
Configure
datacustomcode CLIfor your Data 360 environment.When prompted, enter these details.
<login_url>: Data 360 Sandbox login URL<client_id>: Consumer Key of your external client app<client_secret>: Consumer Secret of your external client app<refresh_token>: The refresh token obtained from the OAuth flow<core_token>(optional): The access token (also called core token) from the OAuth flow response
Data 360 configuration is saved locally for
datacustomcode CLIto authenticate and interact with Data 360 as required.Running the
datacustomcode configurecommand is a one-time setup per environment or profile. Rerun this command only if your credentials or environment details change, or if you want to set up a new profile. -
Create an SDK project in the folder where you set up the SDK.
An SDK project sets up the required directory structure, configuration files, and dependencies for writing, testing, and deploying custom code with the SDK.
The command creates this folder structure.
Directory or File Description Dockerfile Used for containerized builds and deployments. Don’t modify this file. requirements.txt List your script’s Python dependencies here. requirements-dev.txt Development environment dependencies. Don’t modify this file. payload/ Contains your main code and configuration for deployment payload/config.json Data 360 deployment configuration payload/entrypoint.py Main script where you write your batch data transform logic examples/ Example scripts and sample data examples/employee_hierarchy/ An example script to build a Directed Acyclic Graph (DAG) based on employee hierarchy. To use, upload employee_data.csvinto a new Employee DLO, create an Employee_Hierarchy DLO, and copyentrypoint.pycontents intopayload/entrypoint.py. Then run locally and deploy.jupyterlab.sh Script to start JupyterLab for interactive development .devcontainer/ Configuration for VS Code Dev Containers README.md Project overview and instructions -
If needed, go to your SDK project directory.