Skip to main content

EthoPy Logo

PyPI Version Python Versions Documentation License: MIT

A Python framework for automated behavioral experiments with database integration.

EthoPy provides a flexible, state-based system for designing and running behavioral experiments. Built for neuroscience research, it offers tight integration with database storage, cross-platform support, and modular architecture for easy customization.

Getting Started

Requirements

  • Python 3.8 or higher
  • Maria DB Database
    • EthoPy requires database setup before running experiments. Follow our step-by-step guide: Getting Started Guide for a complete setup from installation to first experiment

Installation

pip install ethopy

Run Your First Experiment

# Test with simulation mode (no hardware required)
ethopy --task-path grating_test.py --log-console

# The simulation uses keyboard controls:
# ← → arrow keys: activate lick ports 1 & 2
# spacebar: proximity detection

Key Features

  • State-based Experiments: Flexible state machine design for complex behavioral paradigms
  • Database Integration: Automatic data storage with DataJoint
  • Hardware Agnostic: Supports Raspberry Pi, Arduino, PC interfaces, or simulation mode
  • Multiple Experiment Types: 2AFC, match-to-sample, passive presentation, calibration
  • Rich Stimuli: Visual (gratings, moving bars, dots), olfactory, and custom stimuli
  • Cross-platform: Linux, macOS, Windows compatibility

Architecture Overview

Understanding Ethopy's core architecture is essential for both using the system effectively and extending it for your needs. Ethopy is built around five core modules that work together to provide a flexible and extensible experimental framework. Each module handles a specific aspect of the experiment, from controlling the overall flow to managing stimuli and recording behavior.

EthoPy Architecture
  • Experiment: Defines the state control system with multiple experimental states (PreTrial, Trial, Reward, Punishment, etc.). Each state has four overridable functions that control its behavior and transitions.
  • Behavior: Handles animal responses and actions (port selection, licking activity, proximity detection)
  • Stimulus: Creates and manages presented stimuli (visual, olfactory, auditory)
  • Interface: Hardware communication layer (Raspberry Pi, Arduino, PC interfaces, simulation)
  • Logger: Data storage and management using DataJoint for seamless database integration
Experiment Overview

Ecosystem

Extend EthoPy with additional tools:

Documentation

Full Documentation

Essential Guides:

Contributing

We welcome contributions! See our Contributing Guide for:

  • Development setup
  • Code standards
  • Documentation updates

License

MIT License - see LICENSE for details.

Support

Metadata

Release files for ethopy 0.0.8.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ethopy 0.0.8.8
File Size Uploaded
ethopy-0.0.8.8.tar.gz 1.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ethopy 0.0.8.8
File Interpreter ABI Platform
ethopy-0.0.8.8-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / ethopy-0.0.8.8.tar.gz

Download URL ethopy-0.0.8.8.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
79ffeef8cc09d5f714f2683a1a5e5f474b3ec9b05dbaa50e0e466fe267260119
BLAKE2b-256 checksum
How to use checksums
831a534c38223cce56c1b394ecc7c9c6c7caa6d8edbccc01063c4cc7b00fd6f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / ethopy-0.0.8.8-py3-none-any.whl

Download URL ethopy-0.0.8.8-py3-none-any.whl
Size 137.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be6c1783786bb04dfa35dc7df7872d4108184cf8bdf1807e061baad309e9c752
BLAKE2b-256 checksum
How to use checksums
6c36d2c3ca2298c12ab4672c0a124506bfede785f94cdd454fd8800a2c00d7b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.0.8.8 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page