Contributing¶
Contributions to geopackage-toolkit are welcome. This document explains how to get started.
Development Setup¶
Prerequisites¶
- Python 3.10 or later
- SpatiaLite installed (see Installation)
- Git
Clone and Install¶
git clone https://github.com/Asem-D/geopackage-toolkit.git
cd geopackage-toolkit
pip install -e ".[dev,docs]"
Run Tests¶
# Run all tests
pytest
# Run with verbose output
pytest -v
# Run specific test file
pytest tests/test_validate.py
# Run specific test
pytest tests/test_validate.py::TestValidateLayer::test_osm_buildings -v
Tests run against real GeoPackage data if available (set GPKG_TEST_DATA environment variable), or skip gracefully if not.
Build Documentation¶
# Serve documentation locally (with live reload)
mkdocs serve
# Build static documentation
mkdocs build
The documentation will be available at http://localhost:8000.
Code Style¶
- Docstrings: Google-style (used by mkdocstrings for API reference)
- Type hints: Used in function signatures
- No external dependencies: The core package has zero dependencies
- Windows compatibility: All code must work on Windows with SpatiaLite
Pull Request Process¶
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Add tests for new functionality
- Run the test suite:
pytest - Update documentation if needed
- Commit with a clear message
- Push to your fork
- Open a Pull Request
Commit Messages¶
Use clear, descriptive commit messages:
Add validation for Multipart geometriesFix bbox_filter returning duplicate IDsUpdate documentation with new examples
Pull Request Description¶
Describe:
- What the change does
- Why it is needed
- How to test it
Reporting Issues¶
Open an issue on GitHub with:
- Description: What happened vs. what you expected
- Reproduction: Minimal code to reproduce the issue
- Environment: Python version, OS, SpatiaLite version
- GeoPackage: Sample data if possible (or describe the schema)
Feature Requests¶
Open an issue with:
- Use case: What problem does this solve?
- Proposed API: How would you use it?
- Alternatives: What workarounds exist?
Architecture¶
geopkgtoolkit/
__init__.py # Public API exports
_spatialite.py # SpatiaLite connection helper
validate.py # Geometry validation
query.py # Spatial queries
cli.py # Command-line interface
Design Principles¶
- Zero compiled dependencies: Pure Python + SpatiaLite (SQL extension)
- Windows-first: All code tested on Windows with SpatiaLite
- Rtree by default: Spatial queries use rtree indexing when available
- Auto-indexing: Create rtree indexes automatically when missing
- Clean API: Simple functions with sensible defaults
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.