Local Development
Install and run Potato locally for development and testing. Covers pip install, config setup, launching the dev server, and debugging common startup issues.
Local Development
Get Potato running on your local machine for development and testing.
Prerequisites
- Python 3.7 or higher
- pip package manager
- Git (optional, for cloning examples)
Installation
Using pip (Recommended)
pip install potato-annotationFrom Source
git clone https://github.com/davidjurgens/potato.git
cd potato
pip install -e .With Optional Dependencies
# For audio annotation support
pip install potato-annotation[audio]
# For all optional features
pip install potato-annotation[all]Quick Start
1. Create a Configuration File
Create config.yaml:
task_name: "My First Annotation Task"
server:
port: 8000
data_files:
- path: data.json
text_field: text
annotation_schemes:
- annotation_type: radio
name: sentiment
description: "What is the sentiment?"
labels:
- Positive
- Negative
- Neutral
output:
path: annotations/2. Prepare Sample Data
Create data.json:
[
{"id": "1", "text": "I love this product!"},
{"id": "2", "text": "This is terrible."},
{"id": "3", "text": "It's okay, nothing special."}
]3. Start the Server
potato start config.yaml4. Access the Interface
Open your browser to http://localhost:8000
Development Mode
Hot Reloading
Enable auto-restart when config changes:
potato start config.yaml --reloadDebug Mode
Enable detailed logging:
potato start config.yaml --debugVerbose Output
See all server activity:
potato start config.yaml --verboseDirectory Structure
Recommended project layout:
my-annotation-project/
├── config.yaml # Main configuration
├── data/
│ ├── train.json # Training data
│ └── main.json # Annotation data
├── annotations/ # Output directory
├── templates/ # Custom HTML templates
└── static/ # Custom CSS/JS
Testing Your Configuration
Validate Config
Check for syntax errors:
potato validate config.yamlPreview Mode
Start without saving annotations:
potato start config.yaml --previewTest with Sample Data
Generate test data:
potato generate-data --count 10 --output test_data.jsonCommon Issues
Port Already in Use
# Use a different port
potato start config.yaml --port 8080
# Or in config.yaml
server:
port: 8080Data File Not Found
Ensure paths are relative to the config file location:
# If data is in subdirectory
data_files:
- path: data/main.json
# Or use absolute path
data_files:
- path: /full/path/to/data.jsonPermission Denied
Check file permissions:
chmod 755 annotations/
chmod 644 data/*.jsonMultiple Users Locally
For testing multi-user scenarios:
allow_all_users: true
url_user_id_param: user_idAccess with different users:
http://localhost:8000/?user_id=annotator1http://localhost:8000/?user_id=annotator2
Reset Annotations
Clear all annotations and start fresh:
# Remove annotation files
rm -rf annotations/*
# Restart server
potato start config.yamlEnvironment Variables
Configure via environment:
export POTATO_PORT=8000
export POTATO_DEBUG=true
export POTATO_DATA_PATH=/path/to/data
potato start config.yamlUsing with Virtual Environments
venv
python -m venv potato-env
source potato-env/bin/activate # Linux/Mac
potato-env\Scripts\activate # Windows
pip install potato-annotationConda
conda create -n potato python=3.10
conda activate potato
pip install potato-annotationIDE Integration
VS Code
Install the YAML extension for config file support:
// settings.json
{
"yaml.schemas": {
"https://potato-annotation.com/schema.json": "config.yaml"
}
}PyCharm
Set up a run configuration:
- Add → Python
- Script:
potato - Parameters:
start config.yaml - Working directory: your project path
Next Steps
- Configuration Basics - Learn all config options
- Data Formats - Understand data structure
- Production Setup - Deploy for real use