# Quickstart

To run your script with Gromet, you only need two files:

* A `.yaml` config
* A `.py` script with a `main()` function

***

#### 1. Create a YAML (`.yaml`)

In the **Setup** tab, define:

* `script_name` and `script_description` (used for labelling)
* `python_version` (e.g. "3.12.11")
* A list of `dependencies` (e.g. pandas, openpyxl, etc.)
* A list of `inputs` that your Python function will receive

```yaml
script_name: "Excel Invoice Merger"
script_description: |
  Merge multiple Excel invoice files into a single consolidated report,
  summarising totals and highlighting discrepancies.

python_version: "3.12"
dependencies:
  - pandas==2.2.2
  - openpyxl==3.1.2

inputs:
  - arg: input_file
    title: Upload Excel File
    required: true
    type: file
    extensions: [xlsx, xls]

  - arg: simple_text
    title: Label
    type: text
    placeholder: "Experiment 42"

  - arg: environment
    title: Environment
    type: dropdown
    required: true
    options:
      - value: dev
        label: Development
      - value: staging
        label: Staging
      - value: prod
        label: Production
        
  - arg: accept_terms
    title: Save to database
    type: checkbox
```

**🧠 Dependency Tips**

* If you **omit the version**, Gromet will install the **latest** available version from PyPI.

  ```yaml
  dependencies:
    - openpyxl  # installs the latest
  ```
* To ensure stability, **pin versions**:

  ```yaml
  dependencies:
    - openpyxl==3.1.2
  ```
* Or allow minor updates only:

  ```yaml
  dependencies:
    - openpyxl~=3.1  # latest 3.1.x
  ```
* Incorrect or missing dependencies can cause runtime errors.

***

#### 2. Write Your Script

In the **Script** tab, define a function called `main()` that accepts the same inputs as defined in your YAML. Match names **exactly**.

```python
def main(input_file, simple_text, environment):
    # Your code here
    return
```

📌 Notes:

* Uploaded files are passed as **file paths**
* Dropdowns, text, and date inputs are passed as **strings**
* `multiselect` fields return a list of the selected values, like `["u123", "u128"]`&#x20;

***

#### ✅ Supported Python Versions

Gromet supports running scripts across multiple Python versions. Each version includes the latest stable patch.

* *`3.13.x (coming soon)`*
* **`3.12.11`**
* **`3.11.13`**
* **`3.10.18`**
* **`3.9.23`**

> Gromet will automatically fetch and run the specified version behind the scenes — no setup required.

***

#### 3. Hit ▶ Run

That’s it. Just click **Run**.

Your script will execute with your defined inputs and environment.

> ⏳ The first run may take a few minutes while dependencies and the specified Python version are installed. Future runs are much faster.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gromet.gitbook.io/docs/getting-started/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
