Development
Setup Development Environment
# Clone repository
git clone https://github.com/health-care-affordability-lab/mintd.git
cd mintd
# Create virtual environment and install dependencies
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install with development dependencies (pick one)
uv sync --dev
# or
pip install -e ".[dev]"
For end-user installation (no clone needed), see the Installation Guide.
Project Structure
mintd/
├── src/mintd/ # Main package
│ ├── cli/ # CLI commands (Click-based)
│ ├── files/ # Template files (.j2 Jinja2 templates)
│ ├── templates/ # Template classes (data, project, code, enclave)
│ ├── registry.py # Data Product Catalog integration
│ ├── data_import.py # Data import/push/update/remove operations
│ └── ...
├── tests/ # Test suite
├── docs/ # Documentation (MkDocs)
├── stata/ # Stata ado files
└── pyproject.toml # Project configuration
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=mintd
# Run specific test file
pytest tests/test_templates.py
# Run with verbose output
pytest -v
Code Quality
# Lint with ruff
ruff check src/
# Format with ruff
ruff format src/
# Type check with mypy
mypy src/mintd/
Building Documentation
# Install docs dependencies
pip install -e ".[docs]"
# Serve docs locally
mkdocs serve
# Build docs
mkdocs build
Dependencies
| Package |
Purpose |
click>=8.0 |
CLI framework |
gitpython>=3.1 |
Git operations |
jinja2>=3.0 |
Template rendering |
rich>=13.0 |
Terminal output formatting |
keyring>=24.0 |
Secure credential storage |
boto3>=1.28 |
S3-compatible storage |
pyyaml>=6.0 |
YAML configuration |
dvc>=3.0 |
Data Version Control |
dvc-s3>=3.0 |
S3 storage support for DVC |
pygithub>=2.0.0 |
GitHub API integration |
requests>=2.25.0 |
HTTP client |
frictionless[excel,json]>=5.0 |
Frictionless Table Schema support |
pandas>=2.0 |
Data manipulation and Stata .dta support |
Development Dependencies
| Package |
Purpose |
pytest>=7.0 |
Testing framework |
ruff>=0.1 |
Linting and formatting |
mypy>=1.0 |
Static type checking |
Adding New Templates
- Create Jinja2 template in
src/mintd/files/
- Register in appropriate template class (
DataTemplate, ProjectTemplate, etc.)
- Add tests in
tests/test_templates.py
Adding New CLI Commands
- Create command module in
src/mintd/cli/
- Register with Click group in
src/mintd/cli/__init__.py
- Add tests in
tests/test_cli.py