Getting Started with Dagster#

Dagster is the data orchestration platform built for productivity.

Installing Dagster#

To install Dagster into an existing Python environment, run:

pip install dagster

This will install the latest stable version of the core Dagster packages in your current Python environment.

Writing a Job#

Let's get your first job up and running.

from dagster import job, op


@op
def get_name():
    return "dagster"


@op
def hello(name: str):
    print(f"Hello, {name}!")


@job
def hello_dagster():
    hello(get_name())

Save the code above in a file named hello_world.py.

You can execute the job in three different ways: Dagit, Dagster Python API, or Dagster CLI.

Running the Job in Dagit#

Dagit is a web-based interface for viewing and interacting with Dagster objects.

pip install dagit

To visualize your job in Dagit, run the following command:

dagit -f hello_world.py

Then navigate to http://localhost:3000 to start using Dagit:

dagit-def

Click on the "Launchpad" tab, then press the "Launch Run" button to launch the job.

dagit-run

Running the Job Programmatically#

You can also execute the job without the UI.

Dagster Python API

if __name__ == "__main__":
    result = hello_dagster.execute_in_process()

Dagster CLI

dagster job execute -f hello_world.py

To learn more about Dagster, head over to the Tutorial. And if you get stuck or have any other questions, we'd love to hear from you on Slack:

join-us-on-slack