Skip to main content

Effortlessly conduct chatbot-based interviews with customizable protocols and randomized condition assignments, tailored for social science research.

Project description

boterview logo

AI-based interview studies...
...as smooth as butter

Repository status GitHub version PyPI version PyPI monthly downloads

boterview is a Python package that enables social science researchers to easily deploy chatbot-based interviews with customizable protocols and randomized condition assignment.

Installation

You can install the package from the PyPI repository using pip as follows:

# Install using `pip`.
pip install boterview

Depending on your setup, you may consider using a Python virtual environment before running the command above. For instance, you can create a new virtual environment called .venv and activate it as follows:

# Create a new directory for your study.
mkdir my-study

# Move into the directory.
cd my-study

# Create a new `Python` virtual environment called `.venv`.
python -m venv .venv

# Activate the virtual environment.
source .venv/bin/activate

Development Version

You may also install the development version of the package directly from the GitHub repository using pip as follows:

# Install using `pip`.
pip install boterview@git+https://github.com/mihaiconstantin/boterview

Usage

To use boterview, you need to specify a TOML configuration file for your study, and provide several text files containing the interview-related content, as well as the user interface content (e.g., the study instruction, consent information and more). While all these things can be done manually, boterview provides a command line interface (CLI) to help you with the process.

Commands

To get started, you can run the command below to see all the available command available in the boterview CLI.

# Show all available commands.
boterview --help

Boterview provides four main command groups: generate, parse, preview, and run. For each command, please check the help message (i.e., via --help) to see the available options and arguments.

Content Generation

The boterview generate command can be used to generate various things related to your study. It contains three main subcommands:

  • codes: Used to generate participation codes for your study.
  • secret: Used to generate a random secret required to run the study.
  • study: Used to scaffold an example study setup.

Data Parsing

The boterview parse command can be used to parse the study database. It is used to extract the study data from the sqlite database and save it as a markdown file.

Condition Previewing

The boterview preview command can be used to preview a study condition given a configuration file. This command prints to the console the content that constitutes the system prompt for the bot for a given study condition.

Running the Study

The boterview run command can be used to start a study based on a configuration file. This command starts a web server that serves the study interface and handles the chatbot interactions.

Example

Below you can find a minimal example to get you started with boterview. The commands below assume you have already installed the package.

# Scaffold a study in the current working directory with 100 participation codes, and include a secret.
boterview generate study --path . --quantity 100 --config study.toml --secret

# Preview the default condition setup.
boterview preview --config study.toml --condition "Condition 1"

# Run the study and save the data in the `boterview.db` database file.
boterview run --config study.toml --database boterview.db

At this point, you can access the study at http://localhost:8080.

Suppose several participants have went through the study and you want to download the data. You can do so by navigating to the /download endpoint. The secret required to download the data is stored in the study.toml file (i.e., it was automatically included by the --secret flag used when scaffolding the study).

Alternatively, use the boterview parse command against the database file, which will extract the data and save it as a markdown file in the current working directory. For example:

# Parse the study data.
boterview parse --config study.toml --database boterview.db

Note. We are working on expanding the documentation and adding more examples. For the time being, the instructions above should suffice to get you started with boterview. We also recommend reading the comments in the study configuration file, as well as the application interface default content. See the Contributing section below for more information on how you can help.

Contributing

  • Any contributions are welcome and greatly appreciated. Please open a pull request on GitHub.
  • To report bugs, or request new features, please open an issue on GitHub.

License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boterview-1.3.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

boterview-1.3.0-py3-none-any.whl (699.8 kB view details)

Uploaded Python 3

File details

Details for the file boterview-1.3.0.tar.gz.

File metadata

  • Download URL: boterview-1.3.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for boterview-1.3.0.tar.gz
Algorithm Hash digest
SHA256 761106f5c124678ab18ba41eaa795d6e84c2c3e74b8a25c36b4718a0277d2e4d
MD5 a6dc0f12b78286bc361f88dff1c0f8bd
BLAKE2b-256 1eee7e9f809025d032cb3cea5a1cc44ac6b0e0cf346dc637e9b538ed9c0e220a

See more details on using hashes here.

File details

Details for the file boterview-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: boterview-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 699.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for boterview-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97df58a6091c27a1b8bff98071a0abb1e357a69cdf95ca7d4b8abc0fa44a1209
MD5 1a857dabf26a0dc6eb90f3c9687a03da
BLAKE2b-256 78312d7e21d59eac97cf0b3b65b4a90af4a7e75721013707da3278b9943d2cd7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page