Skip to content

Latest commit

 

History

History
81 lines (56 loc) · 1.5 KB

File metadata and controls

81 lines (56 loc) · 1.5 KB
title Quickstart
description Get started with Davia in minutes by following these simple steps.

Prerequisites

Davia requires Python 3.9 or higher. Make sure you have the correct Python version installed before proceeding.

1. Install Davia

First, install Davia using pip:

pip install davia

2. Create Your First App

Create a new Python file, for example welcome.py, and add the following code:

from davia import Davia

app = Davia()


@app.task
def get_welcome_message(name: str = "there") -> str:
    """
    Return a personalized welcome message.
    """
    return f"Hi {name}! Welcome to Davia !"


if __name__ == "__main__":
    app.run()

3. Run Your App

Run your Python file:

python welcome.py

Alternatively, you can use the Davia CLI command instead of including app.run() in your code:

# Without app.run() in your code
from davia import Davia

app = Davia()


@app.task
def get_welcome_message(name: str = "there") -> str:
    """
    Return a personalized welcome message.
    """
    return f"Hi {name}! Welcome to Davia !"

Then run it with:

davia run welcome.py

Quick demo:

<iframe width="100%" height="315" src="https://www.youtube.com/embed/8VEuvgsLPwA?si=KGjuWvDmTkJQVwW1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" referrerpolicy="strict-origin-when-cross-origin" ></iframe>