Quickstart¶
Build and run your first Repster flow in 5 minutes.
Prerequisites¶
- Python 3.12+
- uv
1. Set up a project¶
A Repster project is a directory with a pyproject.toml and one or more Python files containing @rp.flow() decorators.
mkdir quickstart
cd quickstart
uv init
uv add repster "dlt[duckdb]"
echo "*.duckdb" >> .gitignore
echo ".repster" >> .gitignore
2. Define a flow¶
Replace the content of main.py with the following code:
import dlt
import repster as rp
@rp.flow()
def hackernews_top():
"""Fetch top Hacker News stories into DuckDB."""
@dlt.resource
def top_stories():
import httpx
resp = httpx.get("https://hacker-news.firebaseio.com/v0/topstories.json")
ids = resp.json()[:10]
for story_id in ids:
story = httpx.get(f"https://hacker-news.firebaseio.com/v0/item/{story_id}.json").json()
yield story
pipeline = dlt.pipeline(
pipeline_name="hackernews",
destination="duckdb",
dataset_name="stories",
)
pipeline.run(top_stories())
3. Discover your flows¶
You should see hackernews_top listed with no schedule (it's on-demand only).
4. Run locally¶
Repster runs the flow and stores the result in .repster/ (SQLite). Check the output:
5. Add a schedule (optional)¶
To run on a cron schedule, add schedule to the decorator:
Start the local scheduler:
View the schedule and run history in the local UI at http://localhost:8080.
The scheduler fires flows according to their cron expressions and keeps run history in .repster/.
Next steps¶
- Deploy to cloud →: run your schedules without keeping a machine on
- Manage secrets →: add credentials without hardcoding them
- CLI reference →: all available commands