A public, community-driven agricultural equipment database using a Python-centric stack and Lakehouse architecture. OpenAg-DB provides comprehensive specifications for tractors, combines, implements, and other agricultural equipment.
Frontend: https://adam133.github.io/equipment-testing/
Backend API: Deployed on Google Cloud Run (us-central1)
The frontend is connected to a live FastAPI backend running on Google Cloud Platform, which queries Unity Catalog Delta tables for real agricultural equipment data.
OpenAg-DB is designed to be the go-to resource for agricultural equipment specifications, built on modern data infrastructure:
- Data Model: Pydantic models with polymorphic support for different equipment types
- Storage: Unity Catalog Delta tables for versioned, queryable data
- API: FastAPI backend for serving equipment data
- Scrapers: Polite, scheduled Scrapy spiders for data collection
- Frontend: React + Vite + Shadcn UI for searchable interface
- Community: Open-source contribution model via GitHub
OpenAg-DB/
├── src/
│ ├── api/ # FastAPI backend
│ ├── scrapers/ # Scrapy spiders for data collection
│ ├── core/ # Pydantic models & Unity Catalog utilities
│ └── frontend/ # React/Vite static site
├── .github/workflows/ # CI/CD and scheduled scrapers
└── tests/ # Pytest test suite
- Collection: Scrapy spiders collect equipment data from manufacturer websites
- Validation: All data validated against Pydantic models
- Storage: Data written to Delta tables in Unity Catalog
- Query: FastAPI serves data to frontend
- Contribution: Users suggest corrections via GitHub Issues
OpenAg-DB supports multiple equipment categories with specialized models:
- Horsepower (PTO/Engine)
- Transmission Type
- Hydraulic Flow & Pressure
- Three-Point Hitch Specifications
- Grain Tank Capacity
- Separator Type (Conventional/Rotary/Hybrid)
- Unloading Rate
- Engine Specifications
- Working Width
- Weight
- Required HP Range
- Row Configuration (for planters/cultivators)
# Clone the repository
git clone https://github.com/adam133/equipment-testing.git
cd equipment-testing
# Install dependencies and pre-commit hooks (recommended)
make setup
# Or: uv sync --all-extras --dev && uv run pre-commit install
# Start the API server
uv run openagdb-api
# Visit http://localhost:8000/docs for interactive API documentation
# Run tests
make test
# Or: uv run pytest# Navigate to frontend directory
cd src/frontend
# Install dependencies
npm install
# Start development server
npm run dev
# Visit http://localhost:5173
# Build for production
npm run build- Python 3.12 or higher
- uv - Fast Python package installer
- Node.js 22+ (for frontend development)
- Unity Catalog endpoint with access token (for data storage in production)
If you don't have uv installed:
On macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | shOn Windows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"# Clone the repository
git clone https://github.com/adam133/equipment-testing.git
cd equipment-testing
# Sync Python dependencies
uv sync
# For development with all optional dependencies
uv sync --all-extras# Start the FastAPI development server
uv run openagdb-api
# The API will be available at http://localhost:8000
# Interactive API docs at http://localhost:8000/docsfrom core.models import Tractor, EquipmentCategory, TransmissionType
# Create a tractor instance
tractor = Tractor(
make="John Deere",
model="5075E",
series="5E Series",
year_start=2014,
pto_hp=65,
engine_hp=75,
transmission_type=TransmissionType.POWERSHIFT,
)
# Validate and export
print(tractor.model_dump())# Run a specific spider
uv run scrapy crawl quality_farm_supply -o tractors.json
# List all available spiders
uv run scrapy list- quality_farm_supply: Scrapes tractor specifications from Quality Farm Supply
- Supports multiple makes and models
- Exports to JSON, CSV, and other formats
- See
src/scrapers/spiders/README.mdfor details
- tractordata: Template spider (placeholder)
equipment-testing/
├── .github/workflows/
│ ├── ci.yml # Testing, linting, building
│ └── scraper.yml # Scheduled data collection
├── src/
│ ├── api/ # FastAPI REST API
│ │ └── main.py # API endpoints
│ ├── core/ # Core data models
│ │ ├── models.py # Pydantic equipment models
│ │ └── databricks_utils.py # Unity Catalog utilities
│ ├── scrapers/ # Scrapy data collection
│ │ ├── spiders/ # Spider implementations
│ │ ├── pipelines.py # Data processing pipelines
│ │ └── settings.py # Scrapy configuration
│ ├── frontend/ # React frontend (future)
│ └── equipment_testing/ # Legacy CLI
├── tests/ # Pytest test suite
│ ├── test_models.py # Model tests
│ └── test_api.py # API tests
├── pyproject.toml # Project metadata & dependencies
└── README.md
To add new dependencies to the project:
# Add a production dependency
uv add <package-name>
# Add a development dependency
uv add --dev <package-name>
# Add to specific optional group
uv add --optional iceberg <package-name>This project includes a Makefile with common development tasks:
# Show all available commands
make help
# Install dependencies and pre-commit hooks (first-time setup)
make setup
# Run tests with coverage
make test
# Run linter
make lint
# Format code
make format
# Check formatting without changes
make format-check
# Run type checker
make type-check
# Run all pre-commit hooks
make pre-commit
# Clean build artifacts
make clean# Run all tests
make test
# Or: uv run pytest
# Run with coverage
uv run pytest --cov=core --cov=api --cov-report=term
# Run specific test file
uv run pytest tests/test_models.py
# Run specific test
uv run pytest tests/test_models.py::test_tractor_creationThis project uses pre-commit hooks to automatically check code quality before commits. Pre-commit hooks are automatically installed when you run make setup or make dev.
# Install pre-commit hooks (if not already installed)
make install-hooks
# Or: uv run pre-commit install
# Run hooks manually on all files
make pre-commit
# Or: uv run pre-commit run --all-filesImportant: Pre-commit hooks will automatically run before each commit. If they find issues:
- Auto-fixable issues (formatting, import sorting) will be fixed automatically
- The commit will be blocked so you can review the fixes
- Stage the fixes with
git addand commit again
# Format code with ruff
uv run ruff format src/ tests/
# Check formatting without making changes
uv run ruff format --check src/ tests/
# Lint code with ruff
uv run ruff check src/ tests/
# Fix linting issues automatically
uv run ruff check --fix src/ tests/
# Type checking with mypy
uv run mypy src/If you need to recreate the virtual environment:
# Remove existing environment
rm -rf .venv
# Create new environment and sync dependencies
uv sync# Build distribution packages
uv buildThis will create wheel and source distributions in the dist/ directory.
# Install in development mode
uv pip install -e .Once the API server is running, interactive documentation is available at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
# Health check
curl http://localhost:8000/health
# List all equipment
curl http://localhost:8000/equipment?limit=10
# Filter tractors by manufacturer
curl http://localhost:8000/equipment/tractors?make=John%20Deere
# Submit a contribution
curl -X POST http://localhost:8000/contributions \
-H "Content-Type: application/json" \
-d '{
"field_name": "engine_hp",
"proposed_value": "105",
"notes": "Updated from manufacturer specs"
}'OpenAg-DB uses Pydantic models for data validation and serialization:
- CommonEquipment: Base model with fields shared across all equipment
- Tractor: Extends CommonEquipment with tractor-specific fields
- Combine: Extends CommonEquipment with combine-specific fields
- Implement: Extends CommonEquipment with implement-specific fields
All models support:
- Automatic validation
- Type safety
- JSON serialization
- Time-travel queries (via Iceberg snapshots)
We welcome contributions! Here's how you can help:
- Submit Equipment Data: Use the web interface to suggest corrections
- Improve Scrapers: Add new spiders for additional data sources
- Enhance Models: Propose new equipment types or fields
- Fix Bugs: Report and fix issues on GitHub
See CONTRIBUTING.md for detailed guidelines.
- Initialize project structure
- Define Pydantic models
- Create FastAPI application
- Set up Scrapy framework
- Implement manufacturer-specific spiders (Quality Farm Supply spider)
- Add more data sources and spiders
- Add Unity Catalog Delta table integration
- Configure Unity Catalog connection
- Set up automated scraping workflow
- Integrate DuckDB for queries
- Add authentication/rate limiting
- Implement contribution workflow
- Deploy API to production
- Build React search interface
- Add filtering and sorting
- Deploy to GitHub Pages
- Implement contribution form
- Connect to real API backend
- Automated contribution review
- Data quality metrics
- Community guidelines
- Public API keys
- Language: Python 3.12+
- Package Manager: uv
- Data Models: Pydantic
- API Framework: FastAPI
- Scraping: Scrapy
- Storage: Unity Catalog Delta tables
- Query Engine: DuckDB
- Frontend: React + Vite + Shadcn UI
- CI/CD: GitHub Actions
- Hosting: TBD (API) + GitHub Pages (Frontend)
- Fast: 10-100x faster than pip
- Reliable: Deterministic dependency resolution
- Compatible: Drop-in replacement for pip and pip-tools
- Modern: Built with Rust for performance
- All-in-one: Package management, virtual environments, and more
This project is licensed under the MIT License - see the LICENSE file for details.