# uproot

**uproot** is a modern, open-source framework for developing and conducting browser-based behavioral experiments. Build studies with hundreds of participants, from simple surveys to complex real-time multiplayer games.

[**Try the live demo**](https://demo.uproot.science)

**Source code:** [github.com/mrpg/uproot](https://github.com/mrpg/uproot) <br>
**Examples:** [github.com/mrpg/uproot-examples](https://github.com/mrpg/uproot-examples)

!!! warning "Work in progress"

    uproot is in initial development. Breaking changes may occur between releases. The announcements shown in the admin interface will tell you when action is needed.

<div class="grid cards mt-4" markdown>

-   __Get started in minutes__

    ---

    Install uproot with a single command and create your first experiment.

    [Installation](https://uproot.science/getting-started/installation.md)

-   __Learn by doing__

    ---

    Follow the tutorial to build a complete prisoner’s dilemma experiment.

    [Tutorial](https://uproot.science/getting-started/tutorial.md)

-   __Built for multiplayer__

    ---

    Group participants, synchronize progress, and enable real-time interaction.

    [Multiplayer experiments](https://uproot.science/multiplayer/groups.md)

-   __Explore examples__

    ---

    Ready-to-use experiments covering common paradigms and techniques.

    [Example apps](https://github.com/mrpg/uproot-examples)

-   __AI-assisted development__

    ---

    Build experiments faster with Claude Code, Codex, and other agentic coding tools.

    [Set up AI tooling](https://uproot.science/getting-started/installation.md#set-up-ai-assisted-development)

</div>

## Why uproot?

- **Reproducible experiments:** Your project folder plus `uv` recreates the exact software environment of your study, years later.
- **Real-time multiplayer:** Built-in support for grouping participants, synchronization, and live interactions.
- **Flexible data storage:** Append-only log ensures data persistence and supports arbitrary data types.
- **Modern stack:** Built on [FastAPI](https://fastapi.tiangolo.com/) for performance and reliability.
- **100% open source:** LGPL-licensed with no vendor lock-in.

[**The full case for uproot**](https://uproot.science/why-uproot.md)

## Quick example

Here is the complete Python code of a two-player prisoner’s dilemma:

```python
from uproot.fields import *
from uproot.smithereens import *

DESCRIPTION = "Prisoner's dilemma"
SUGGESTED_MULTIPLE = 2

class C:
    PAYOFF_MATRIX = {
        # (you cooperate, other cooperates): your payoff
        (True, True): 10,
        (True, False): 0,
        (False, True): 15,
        (False, False): 3,
    }

class Instructions(Page):
    pass

class GroupPlease(GroupCreatingWait):
    group_size = 2

class Dilemma(Page):
    fields = dict(
        cooperate=RadioField(
            label="Do you wish to cooperate?",
            choices=[(True, "Yes"), (False, "No")],
        ),
    )

class Sync(SynchronizingWait):
    @classmethod
    def all_here(page, group: GroupType) -> None:
        for player in group.players:
            player.payoff = C.PAYOFF_MATRIX[
                player.cooperate,
                player.other_in_group.cooperate,
            ]

class Results(Page):
    pass

page_order = [
    Instructions,
    GroupPlease,
    Dilemma,
    Sync,
    Results,
]
```

[Browse the complete example](https://github.com/mrpg/uproot-examples/tree/main/prisoners_dilemma) including HTML templates

## Getting in touch

uproot is developed by **[Max Grossmann](https://max.pm/)** and **[Holger Gerhardt](https://www.econ.uni-bonn.de/iame/gerhardt)**. Click [here](https://uproot.science/legal.md) for more information.
