# Ethopy Analysis
A comprehensive Python package for analyzing and visualizing behavioral data from Ethopy experiments.
## Overview
Ethopy Analysis provides a modern, modular approach to behavioral data analysis with the following key features:
- **DataFrame-based**: Most of plotting functions work with pandas DataFrames, making them independent of data source
- **Modular Design**: Composable functions for different analysis levels (animal, session, comparison)
- **Database Agnostic**: Works with DataJoint databases, CSV files, or any pandas-compatible data source
- **Extensible**: Plugin system for custom plots and analysis functions
- **Production Ready**: Command-line interface, proper packaging, and configuration management
## Installation
### From Source (Development)
Setting Up a Virtual Environment¶
Before installing dependencies, it's recommended to use a virtual environment to keep your project isolated and manageable.
```bash
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
```
installing dependencies:
```bash
# Clone the repository
git clone <repository-url>
cd Visualisations
# Install in development mode
pip install -e .
```
### Dependencies
- pandas >= 1.3.0
- matplotlib >= 3.5.0
- seaborn >= 0.11.0
- numpy >= 1.20.0
- plotly >= 5.0.0
- datajoint >= 0.13.0 (for database access)
- click >= 8.0.0 (for CLI)
## Package Structure
```
ethopy-analysis/
├── src/ethopy_analysis/
│ ├── data/ # Data loading and processing
│ │ ├── loaders.py # Main data loading functions
│ │ ├── analysis.py # Data analysis functions
│ │ └── utils.py # Data processing utilities
│ ├── plots/ # Plotting functions (DataFrame-based)
│ │ ├── animal.py # Animal-level plots
│ │ ├── session.py # Session-level plots
│ │ ├── comparison.py # Multi-animal/condition comparisons
│ │ └── utils.py # Plotting utilities and plugin system
│ ├── db/ # Database connectivity
│ │ ├── schemas.py # Database schema management
│ │ └── utils.py # Database utility functions
│ ├── config/ # Configuration management
│ │ └── settings.py # Configuration loading and validation
│ └── cli.py # Command-line interface
├── examples/ # Example notebooks and scripts
│ ├── load_example.ipynb
│ ├── animal_analysis_example.ipynb
│ └── session_analysis_example.ipynb
├── pyproject.toml # Package configuration
└── README.md
```
## Configuration
### Database Setup
Create a configuration file for database access:
```bash
ethopy-analysis create-config --output-path config.json
```
Edit the configuration file:
```json
{
"database": {
"host": "your-database.org:3306",
"user": "your_username",
"password": "your_password",
"schemas": {
"experiment": "lab_experiments",
"stimulus": "lab_stimuli",
"behavior": "lab_behavior"
}
}
}
```
### Environment Variables
Alternatively, use environment variables:
```bash
export DJ_HOST="database.example.org:3306"
export DJ_USER="your_username"
export DJ_PASSWORD="your_password"
```
## Examples and Tutorials
Check out the `examples/` directory for comprehensive notebooks:
- **`load_example.ipynb`**: Comprehensive animal-level analysis
- **`animal_analysis_example.ipynb`**: Comprehensive animal-level analysis
- **`session_analysis_example.ipynb`**: Detailed session-level analysis
## Contributing
### Adding New Plot Functions
1. Create your plotting function in the appropriate module
2. Follow the DataFrame-based input convention
3. Return `(fig, ax)` or `(fig, axes)` tuple
4. Import and use directly in your analysis
### Code Style
- Functions over classes where possible
- Clear, descriptive function names
- Pandas DataFrames for data exchange
- Matplotlib for plotting (with optional Plotly support)
Raw data
{
"_id": null,
"home_page": null,
"name": "ethopy-analysis",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "neuroscience, behavior, data-analysis, visualization, ethopy",
"author": "Ethopy Analysis Contributors",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/7a/a4/da27aab644d8205e2a59e2c0123433102c0d4935caa8849bf22f43f3124e/ethopy_analysis-0.1.2.tar.gz",
"platform": null,
"description": "# Ethopy Analysis\n\nA comprehensive Python package for analyzing and visualizing behavioral data from Ethopy experiments.\n\n## Overview\n\nEthopy Analysis provides a modern, modular approach to behavioral data analysis with the following key features:\n\n- **DataFrame-based**: Most of plotting functions work with pandas DataFrames, making them independent of data source\n- **Modular Design**: Composable functions for different analysis levels (animal, session, comparison)\n- **Database Agnostic**: Works with DataJoint databases, CSV files, or any pandas-compatible data source\n- **Extensible**: Plugin system for custom plots and analysis functions\n- **Production Ready**: Command-line interface, proper packaging, and configuration management\n\n## Installation\n\n### From Source (Development)\n\nSetting Up a Virtual Environment\u00b6\n\nBefore installing dependencies, it's recommended to use a virtual environment to keep your project isolated and manageable.\n```bash\npython -m venv venv\nsource venv/bin/activate # On Windows use: venv\\Scripts\\activate\n```\ninstalling dependencies:\n```bash\n# Clone the repository\ngit clone <repository-url>\ncd Visualisations\n\n# Install in development mode\npip install -e .\n```\n\n### Dependencies\n\n- pandas >= 1.3.0\n- matplotlib >= 3.5.0\n- seaborn >= 0.11.0\n- numpy >= 1.20.0\n- plotly >= 5.0.0\n- datajoint >= 0.13.0 (for database access)\n- click >= 8.0.0 (for CLI)\n\n## Package Structure\n\n```\nethopy-analysis/\n\u251c\u2500\u2500 src/ethopy_analysis/\n\u2502 \u251c\u2500\u2500 data/ # Data loading and processing\n\u2502 \u2502 \u251c\u2500\u2500 loaders.py # Main data loading functions\n\u2502 \u2502 \u251c\u2500\u2500 analysis.py # Data analysis functions\n\u2502 \u2502 \u2514\u2500\u2500 utils.py # Data processing utilities\n\u2502 \u251c\u2500\u2500 plots/ # Plotting functions (DataFrame-based)\n\u2502 \u2502 \u251c\u2500\u2500 animal.py # Animal-level plots\n\u2502 \u2502 \u251c\u2500\u2500 session.py # Session-level plots\n\u2502 \u2502 \u251c\u2500\u2500 comparison.py # Multi-animal/condition comparisons\n\u2502 \u2502 \u2514\u2500\u2500 utils.py # Plotting utilities and plugin system\n\u2502 \u251c\u2500\u2500 db/ # Database connectivity\n\u2502 \u2502 \u251c\u2500\u2500 schemas.py # Database schema management\n\u2502 \u2502 \u2514\u2500\u2500 utils.py # Database utility functions\n\u2502 \u251c\u2500\u2500 config/ # Configuration management\n\u2502 \u2502 \u2514\u2500\u2500 settings.py # Configuration loading and validation\n\u2502 \u2514\u2500\u2500 cli.py # Command-line interface\n\u251c\u2500\u2500 examples/ # Example notebooks and scripts\n\u2502 \u251c\u2500\u2500 load_example.ipynb\n\u2502 \u251c\u2500\u2500 animal_analysis_example.ipynb\n\u2502 \u2514\u2500\u2500 session_analysis_example.ipynb\n\u251c\u2500\u2500 pyproject.toml # Package configuration\n\u2514\u2500\u2500 README.md\n```\n\n## Configuration\n\n### Database Setup\n\nCreate a configuration file for database access:\n\n```bash\nethopy-analysis create-config --output-path config.json\n```\n\nEdit the configuration file:\n\n```json\n{\n \"database\": {\n \"host\": \"your-database.org:3306\",\n \"user\": \"your_username\",\n \"password\": \"your_password\",\n \"schemas\": {\n \"experiment\": \"lab_experiments\",\n \"stimulus\": \"lab_stimuli\",\n \"behavior\": \"lab_behavior\"\n }\n }\n}\n```\n\n### Environment Variables\n\nAlternatively, use environment variables:\n\n```bash\nexport DJ_HOST=\"database.example.org:3306\"\nexport DJ_USER=\"your_username\"\nexport DJ_PASSWORD=\"your_password\"\n```\n\n## Examples and Tutorials\n\nCheck out the `examples/` directory for comprehensive notebooks:\n\n- **`load_example.ipynb`**: Comprehensive animal-level analysis\n- **`animal_analysis_example.ipynb`**: Comprehensive animal-level analysis\n- **`session_analysis_example.ipynb`**: Detailed session-level analysis\n\n## Contributing\n\n### Adding New Plot Functions\n\n1. Create your plotting function in the appropriate module\n2. Follow the DataFrame-based input convention\n3. Return `(fig, ax)` or `(fig, axes)` tuple\n4. Import and use directly in your analysis\n\n### Code Style\n\n- Functions over classes where possible\n- Clear, descriptive function names\n- Pandas DataFrames for data exchange\n- Matplotlib for plotting (with optional Plotly support)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Data analysis and visualization package for Ethopy behavioral experiments",
"version": "0.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/ef-lab/ethopy_analysis/issues",
"Documentation": "https://ef-lab.github.io/ethopy_analysis",
"Homepage": "https://github.com/ef-lab/ethopy_analysis",
"Repository": "https://github.com/ef-lab/ethopy_analysis"
},
"split_keywords": [
"neuroscience",
" behavior",
" data-analysis",
" visualization",
" ethopy"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b138f4ed8ab2f5ea36c772f4bce7933b294181a57151d5dfdf01d75a67b53e6c",
"md5": "834b2f8408246967a08fe203d6fa1f63",
"sha256": "8ddb3eaada03d442d00c8106e3c8f6fca3376b5eea6b531762da35ca5b5d48a2"
},
"downloads": -1,
"filename": "ethopy_analysis-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "834b2f8408246967a08fe203d6fa1f63",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 47283,
"upload_time": "2025-07-16T09:56:50",
"upload_time_iso_8601": "2025-07-16T09:56:50.018840Z",
"url": "https://files.pythonhosted.org/packages/b1/38/f4ed8ab2f5ea36c772f4bce7933b294181a57151d5dfdf01d75a67b53e6c/ethopy_analysis-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7aa4da27aab644d8205e2a59e2c0123433102c0d4935caa8849bf22f43f3124e",
"md5": "235a56fd032f99d1b03912e3f8ab0289",
"sha256": "f7c5fa96fd6f50eac723a7d80874b0b268fd4f95a1d4a3e241ce995e1a17bc1b"
},
"downloads": -1,
"filename": "ethopy_analysis-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "235a56fd032f99d1b03912e3f8ab0289",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 2084903,
"upload_time": "2025-07-16T09:56:52",
"upload_time_iso_8601": "2025-07-16T09:56:52.057555Z",
"url": "https://files.pythonhosted.org/packages/7a/a4/da27aab644d8205e2a59e2c0123433102c0d4935caa8849bf22f43f3124e/ethopy_analysis-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-16 09:56:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ef-lab",
"github_project": "ethopy_analysis",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ethopy-analysis"
}