Skip to content

Quick Start

Welcome to Datallog! This guide will get you from zero to a running automation in just a few minutes. Datallog allows you to write simple Python functions, called tasks, and run them as a distributed automation in the cloud. It handles all the complex infrastructure, so you can focus on your code.

Prerequisites

TIP

Before installing, it's a good idea to update your system packages to ensure you have the latest security patches and dependencies.

Linux

You can update your system packages using the following commands based on your distribution:

Ubuntu/Debian
bash
sudo apt-get update && sudo apt-get upgrade -y
Fedora/RHEL/CentOS
bash
sudo dnf update -y
Arch Linux
bash
sudo pacman -Syu

macOS

on macOS you can update Homebrew and installed packages with:

bash
brew update && brew upgrade

Windows (via WSL)

Datallog runs in a Linux environment. On Windows, you can achieve this using the Windows Subsystem for Linux (WSL).

  1. Install WSL: Follow the official Microsoft guide to install WSL. We recommend installing the Ubuntu distribution.

Once WSL and Docker are set up, open your WSL terminal (e.g., Ubuntu) and follow the Linux installation instructions below.

macOS

Ensure you have the Homebrew package manager installed. The installer script will use it to manage dependencies.

Linux

Ensure you have either the curl or wget command available. You can install them using your system's package manager (e.g., sudo apt install curl wget).

Installation

Installing the Datallog SDK is a simple one-liner. The script will automatically install all necessary dependencies, including pyenv, Docker, and the Datallog CLI.

Open your terminal (or your WSL terminal on Windows) and run one of the following commands:

bash
curl -SsLf https://mwm.datallog.com/install.sh | bash

Or, if you prefer wget:

bash
wget -qO- https://mwm.datallog.com/install.sh | bash

After the installation is complete, restart your terminal for the PATH changes to take effect.

Verify the installation by checking the version:

bash
datallog --version

Creating Your First Automation

Let's build a simple "Hello, World!" automation. 🚀

1. Initialize a Project

First, create a new directory for your project, navigate into it, and initialize a Datallog project.

bash
datallog create-project my-first-datallog-project
cd my-first-datallog-project

This command creates a project.ini file, which manages your project's configuration and automations.

2. Create an Automation

Now, let's create a new automation within the project. We'll call it hello-auto.

bash
datallog create-automation hello-auto

This will create a new directory named hello-auto with a default Python file inside.

3. Write the Code

Open the automations/hello-auto/hello-auto.py file and replace its contents with the following code:

python
from datallog import core_task, task

# The first task in our automation.
# The `next_task` argument tells Datallog where to send the output.
@core_task(next_task="second_task")
def first_task(seed):
  """
  This function is the entry point and returns a simple string.
  The 'seed' argument is the initial data passed when the automation is run.
  """
  return seed["message"] if seed else "Hello, World!"

# The second and final task.
@task()
def second_task(text_input):
  """
  This function receives the output from 'first_task'
  and returns an uppercase version of it.
  """
  return text_input.upper()

4. Run the Automation

TIP

You can provide initial seed data to your automation in two ways:

  • Use --seed for small, direct JSON values from the command line (e.g., datallog run hello-auto --seed '{"message": "Hello!"}').
  • Use --seed-file for larger or more complex JSON data stored in a file (e.g., datallog run hello-auto --seed-file seed.json).
    If you don't specify either option but a seed.json file exists in your automation's directory, it will be used automatically.
    Note: --seed and --seed-file cannot be used together.

You can run your automation locally to test it. Use the run command followed by the automation name.

bash
datallog run hello-auto

You should see output indicating the tasks are being executed, with the final result being printed to the console.