https://github.com/catalystneuro/dandi-annotations
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.6%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: catalystneuro
- License: bsd-3-clause
- Language: HTML
- Default Branch: main
- Size: 193 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
- Releases: 0
Metadata Files
README.md
DANDI External Resources Annotations
This repository provides tools for creating and managing external resource annotations for DANDI datasets, including a Flask web application with a user-friendly interface.
Project Structure
dandi-annotations/
├── pyproject.toml # Modern Python project configuration
├── environment.yml # Conda environment specification
└── src/ # Source code directory
└── dandiannotations/ # Main package
├── __init__.py # Package initialization
├── models/ # Pydantic models
│ └── models.py # ExternalResource and AnnotationContributor models
├── scripts/ # Command-line scripts
│ ├── create_resource_from_code.py
│ └── create_resource_from_yaml.py
├── external_resources/ # YAML data storage
│ └── external_resources.yaml
└── webapp/ # Flask web application
├── __init__.py # Webapp package initialization
├── app.py # Main Flask application
├── templates/ # HTML templates
├── static/ # CSS, JavaScript, assets
└── utils/ # Utility modules
├── schema_utils.py
└── yaml_handler.py
Quick Start
1. Environment Setup
Option A: Update existing environment
bash
conda activate dandi_annotations_env
pip install -e .
Option B: Create new environment from file
bash
conda env create -f environment.yml
conda activate dandi_annotations_env
2. Run the Web Application
bash
cd src/dandiannotations/webapp
python app.py
3. Access the Application
Open your web browser and navigate to: http://127.0.0.1:5000
Web Application Features
- Submission-Focused Interface: Clean, streamlined form for submitting external resource annotations
- Professional UI: Responsive Bootstrap 5 styling with DANDI design principles
- Review Workflow Integration: Submissions are saved for review via pull request process
- Pydantic Integration: Uses existing
ExternalResourceandAnnotationContributormodels - YAML Storage: Saves data in the same format as
external_resources.yaml - Automatic Backups: Creates timestamped backups before modifications
- Comprehensive Validation: Client-side and server-side validation with helpful error messages
- Auto-save: Preserves form data in browser localStorage
Form Fields
The webapp includes a streamlined submission form with the following fields:
Resource Information
- Identifier: Optional identifier for the resource
- Title: Name/title of the resource (required)
- URL: Web address of the resource (required)
- Repository: Name of the hosting repository (required)
- Resource Relation: Relationship to the dataset (dropdown, required)
- Resource Type: Type of resource (dropdown, required)
Annotation Contributor
- Name: Contributor's full name (required)
- Email: Contributor's email address (required)
- ORCID: Optional ORCID identifier (auto-formatted)
- URL: Optional contributor website
Submission Workflow
- Form Submission: User fills out and submits the form for review
- Validation: Data is validated using Pydantic models
- Backup: Current YAML file is backed up with timestamp
- Storage: New resource is appended to
external_resources.yaml - Review Process: Submission goes through pull request review before official integration
- Confirmation: Success page confirms submission and explains review process
Validation Features
- Email Format: Validates proper email structure
- URL Format: Ensures valid HTTP/HTTPS URLs
- ORCID Format: Validates ORCID identifier format
- Required Fields: Enforces required field completion
- Pydantic Integration: Uses existing models for comprehensive validation
Development
The project uses modern Python development practices:
- pyproject.toml: Modern dependency management and project configuration
- Conda Integration: Works with existing
dandi_annotations_envenvironment - Code Quality Tools: Pre-configured black, isort, mypy, and pytest
- Type Hints: Full type annotation support
Adding New Fields
- Update the form template (
src/dandiannotations/webapp/templates/form.html) - Add validation in
src/dandiannotations/webapp/app.py - Update the Pydantic models if needed
- Add any new schema options to
src/dandiannotations/webapp/utils/schema_utils.py
Customizing Styles
Edit src/dandiannotations/webapp/static/css/style.css to modify the appearance. The design uses Bootstrap 5 with custom overrides.
Integration with DANDI
This webapp seamlessly integrates with your existing DANDI annotation workflow:
- Model Compatibility: Uses existing
ExternalResourceandAnnotationContributormodels - YAML Format: Outputs data compatible with existing
external_resources.yaml - Safe Operations: Creates automatic backups before file modifications
- Schema Compliance: Ensures all data meets DANDI schema requirements
Troubleshooting
Common Issues
- Import Errors: Ensure the virtual environment is activated
- YAML File Not Found: The app will create the file on first use
- Validation Errors: Check that your Pydantic models are compatible
- Port Already in Use: Change the port in
src/dandiannotations/webapp/app.pyor stop other Flask apps
Debug Mode
The app runs in debug mode by default for development. To disable:
python
app.run(debug=False, host='127.0.0.1', port=5000)
Security Notes
- Change the secret key in
src/dandiannotations/webapp/app.pyfor production use - Consider adding authentication for production deployment
- Validate all user inputs (already implemented)
- Use HTTPS in production environments
Command Line Tools
The repository also includes command-line tools for working with external resources:
src/dandiannotations/scripts/create_resource_from_code.py: Create resources programmaticallysrc/dandiannotations/scripts/create_resource_from_yaml.py: Create resources from YAML files
Running the Scripts
```bash
Create a resource programmatically
python src/dandiannotations/scripts/createresourcefrom_code.py
Create resources from YAML file
python src/dandiannotations/scripts/createresourcefrom_yaml.py ```
License
See LICENSE file for details.
Owner
- Name: CatalystNeuro
- Login: catalystneuro
- Kind: organization
- Email: hello@catalystneuro.com
- Website: catalystneuro.com
- Twitter: catalystneuro
- Repositories: 87
- Profile: https://github.com/catalystneuro
GitHub Events
Total
- Delete event: 1
- Issue comment event: 1
- Push event: 38
- Pull request event: 2
- Create event: 5
Last Year
- Delete event: 1
- Issue comment event: 1
- Push event: 38
- Pull request event: 2
- Create event: 5