# Local Setup (without Docker)

If you prefer not to use Docker, you can install Tampio's dependencies natively. The tricky part is libvoikko and the Finnish morphological dictionary — the Docker path handles all of this for you, so that's recommended if you just want to try the examples.

## Prerequisites

- Python 3.8+
- [libvoikko](https://voikko.puimula.org/) — Finnish morphology library
- `python3-libvoikko` — Python bindings for libvoikko
- fi-x-morpho dictionary — the specific Finnish dictionary Tampio requires

## Ubuntu / Debian

```sh
# Install libvoikko, Python bindings, and the base voikko-fi package
sudo apt-get update
sudo apt-get install -y libvoikko-dev voikko-fi python3 python3-libvoikko curl unzip

# Download the fi-x-morpho dictionary (not available via apt)
# This installs it system-wide; alternatively unzip to ~/.voikko/
curl -fsSL https://www.puimula.org/htp/testing/voikko-snapshot-v5/dict-morpho.zip \
    -o /tmp/dict-morpho.zip
sudo unzip /tmp/dict-morpho.zip -d /usr/lib/voikko
rm /tmp/dict-morpho.zip
```

> **Note:** The `voikko-fi` apt package only ships `mor-standard`. Tampio requires the `fi-x-morpho` variant, which is why the manual download step is needed.

## macOS

Install voikko via Homebrew:

```sh
brew install libvoikko
pip3 install libvoikko
```

Then download the dictionary manually:

```sh
mkdir -p ~/.voikko
curl -fsSL https://www.puimula.org/htp/testing/voikko-snapshot-v5/dict-morpho.zip \
    -o /tmp/dict-morpho.zip
unzip /tmp/dict-morpho.zip -d ~/.voikko
rm /tmp/dict-morpho.zip
```

> macOS compatibility is not officially tested — if you run into issues, Docker is the reliable fallback.

## Install Tampio

Tampio is not on PyPI. Clone it directly from GitHub:

```sh
git clone https://github.com/fergusq/tampio.git
```

Optionally add a wrapper so you can call `tampio` from anywhere:

```sh
echo '#!/bin/sh\npython3 /path/to/tampio/tampio.py "$@"' > /usr/local/bin/tampio
chmod +x /usr/local/bin/tampio
```

## Verify

```sh
echo 'Kun nykyinen sivu avautuu, teksti "Hei!" näytetään käyttäjälle.' \
    | python3 tampio/tampio.py /dev/stdin
```

If you see HTML output, the setup is working.

## Build the Examples

From the Tampiorama root:

```sh
# Override the Docker command with a direct tampio call
make TAMPIO="python3 /path/to/tampio/tampio.py -i -p"
```

Or compile manually:

```sh
python3 /path/to/tampio/tampio.py -i -p examples/basics/hello.itp > examples/basics/hello.html
```
