You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Docker support like [Docker Desktop](https://docs.docker.com/desktop/)
16
+
- A salesforce org, with some DLOs or DMOs with data
17
+
- A [connected app](#creating-a-connected-app)
18
+
11
19
## Installation
12
20
The SDK can be downloaded directly from PyPI with `pip`:
13
21
```
@@ -19,12 +27,16 @@ You can verify it was properly installed via CLI:
19
27
datacustomcode version
20
28
```
21
29
22
-
## Development Setup
23
-
We offer two built-in development interfaces: `devcontainers` and Jupyter, but you can set up any tool you would like manually.
30
+
## Quick start
31
+
Ensure you have all the [prerequisites](#prerequisites) prepared on your machine.
24
32
25
-
To get started, use the CLI to initialize a new development environment:
26
-
```
27
-
datacustomcode init [DIRECTORY TO DUMP NEW REPO]
33
+
To get started, create a directory and initialize a new project with the CLI:
34
+
```zsh
35
+
mkdir datacloud &&cd datacloud
36
+
python3.11 -m venv .venv
37
+
source .venv/bin/activate
38
+
pip install salesforce-data-customcode
39
+
datacustomcode init my_package
28
40
```
29
41
30
42
This will yield all necessary files to get started:
@@ -43,11 +55,31 @@ This will yield all necessary files to get started:
43
55
*`Dockerfile` <spanstyle="color:grey;font-style:italic;">(Do not update)</span> – Development container emulating the remote execution environment.
44
56
*`requirements-dev.txt` <spanstyle="color:grey;font-style:italic;">(Do not update)</span> – These are the dependencies for the development environment.
45
57
*`jupyterlab.sh` <spanstyle="color:grey;font-style:italic;">(Do not update)</span> – Helper script for setting up Jupyter.
46
-
*`requirements.txt` – Here you define the requirements that you will need remotely
58
+
*`requirements.txt` – Here you define the requirements that you will need for your script.
47
59
*`payload` – This folder will be compressed and deployed to the remote execution environment.
48
60
*`config.json` – This config defines permissions on the back and can be generated programmatically with `scan` CLI method.
49
61
*`entrypoint.py` – The script that defines the data transformation logic.
50
62
63
+
A functional entrypoint.py is provided so you can run once you've configured your connected app:
64
+
```zsh
65
+
cd my_package
66
+
datacustomcode configure
67
+
datacustomcode run ./payload/entrypoint.py
68
+
```
69
+
70
+
> [!IMPORTANT]
71
+
> The example entrypoint.py requires a `Account_Home__dll` DLO to be present. And in order to deploy the script (next step), the output DLO (which is `Account_Home_copy__dll` in the example entrypoint.py) also needs to exist and be in the same dataspace as `Account_Home__dll`.
72
+
73
+
After modifying the `entrypoint.py` as needed, using any dependencies you add in the `.venv` virtual environment, you can run this script in Data Cloud:
> The `deploy` process can take several minutes. If you'd like more feedback on the underlying process, you can add `--debug` to the command like `datacustomcode --debug deploy --path ./payload --name my_custom_script`
81
+
82
+
51
83
## API
52
84
53
85
You entry point script will define logic using the `Client` object which wraps data access layers.
0 commit comments