# Getting started

> Install the UiPath SDK, scaffold a Python function project, and run your first function locally.

This page walks you through installing the SDK, scaffolding a project, and running your first Python function locally.

## Prerequisites

- Python 3.10 or later.
- The [`uipath` CLI and SDK](https://uipath.github.io/uipath-python/), installed with `pip`.
- A UiPath account with access to Orchestrator (for publishing and invoking).

## Install the SDK

```bash
pip install uipath
```

Verify the installation:

```bash
uipath --version
```

## Scaffold a project

Create a new function project:

```bash
uipath new my-function
```

This scaffolds the files you edit:

| File | Purpose |
|---|---|
| `main.py` | Your function logic and the `Input`/`Output` models. Starts as a runnable example. |
| `pyproject.toml` | Project metadata and dependencies. |
| `uipath.json` | Declares the callable entry points. The scaffold registers `main` for you. |

## Write your first function

Replace the scaffolded logic in `main.py`:

```python
from pydantic.dataclasses import dataclass

@dataclass
class Input:
    message: str = ""

@dataclass
class Output:
    reply: str = ""

def main(input: Input) -> Output:
    return Output(reply=f"Hello, {input.message}!")
```

The scaffolded `uipath.json` already declares this entry point:

```json
{
  "functions": {
    "main": "main.py:main"
  }
}
```

The key (`main`) is the entry-point name used in CLI commands; the value references the file and function. Update it only if you rename the function or add more entry points.

## Generate the project schema

Once your `Input` and `Output` are defined, generate the schema and bindings:

```bash
uipath init
```

This reads your code and `uipath.json` and generates:

| File | Purpose |
|---|---|
| `entry-points.json` | Input/output JSON Schema derived from your models, used for variable binding. |
| `bindings.json` | Resource binding manifest, created with an empty structure only when the file does not already exist. |

Re-run `uipath init` whenever you change your `Input` or `Output` models. It regenerates `entry-points.json` and never modifies `bindings.json` — resource bindings are maintained by hand. For what they do and how to declare them, see [Resource bindings](resource-bindings.md).

## Run it locally

```bash
uipath run main '{"message": "world"}'
```

Local runs resolve platform resources through the entries in `bindings.json`, so you can test against real Orchestrator assets and buckets before publishing. The same entries are what let each resource be remapped when the package runs in another tenant.

## Next steps

- [Build Python functions](building-python-functions.md) — typed schemas, error handling, and multiple entry points.
- [Resource bindings](resource-bindings.md) — declare the platform resources your function reaches.
- [Package and publish](packaging-and-publishing.md) — deploy to Orchestrator.
