Contributing to Shapelib#
Development Setup#
Clone the repository:
git clone https://github.com/g-e-o-i-a/shapelib.git
cd shapelib
Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # Linux/Mac
Install dependencies:
pip install -e ".[dev]"
Run tests:
pytest tests/
Code Style#
Follow PEP 8
Use type hints (mypy –strict)
NumPy-style docstrings
English for code and comments
Adding New Features#
Adding a New File Format Handler#
Create handler in
src/shapelib/core/handlers/Use
@register_handlerdecoratorImplement
GeoFileHandlerinterface
from shapelib.factories.registry import register_handler
@register_handler(file_extension=".xyz")
class XyzHandler(GeoFileHandler):
...
Adding a New Cloud Provider#
Create provider in
src/shapelib/core/cloud/providers/Use
@register_cloud_providerdecoratorImplement
CloudProviderprotocol
from shapelib.factories.cloud_registry import register_cloud_provider
@register_cloud_provider
class GcsProvider:
def supports(self, cloud_path: CloudPath) -> bool: ...
def upload(self, source: Path, cloud_path: CloudPath) -> None: ...
def download(self, cloud_path: CloudPath, destination: Path) -> Path: ...
def file_exists(self, cloud_path: CloudPath) -> bool: ...
Running Tests#
# All tests
pytest tests/
# With coverage
pytest tests/ --cov=shapelib
# Specific test file
pytest tests/test_cloud_support.py
Contact#
For questions: rodrigo@geoia.tech