Easily integrate state-of-the-art machine learning models in your app
from picterra import APIClient
# Replace this with the id of one of your detectors
detector_id = 'd552605b-6972-4a68-8d51-91e6cb531c24'
# Set the PICTERRA_API_KEY environment variable to define your API key
client = APIClient()
print('Uploading raster...')
raster_id = client.upload_raster('data/raster1.tif', name='a nice raster')
print('Upload finished, starting detector...')
result_id = client.run_detector(detector_id, raster_id)
client.download_result_to_feature_collection(result_id, 'result.geojson')
print('Detection finished, results are in result.geojson')
pip install picterra
See the examples
folder for examples.
API Reference and User Guide available on Read the Docs
Make sure you have Python
and pip
in your OS and create a virtual environment in the root folder, eg
python3 -m venv .venv
source .venv/bin/activate
Running
pip install --editable '.[lint,test]'
would allow to run test and linting locally, and also avoid re-installing the library every time you change the code.
In order to test locally, run:
pytest
- Bump the version number in
setup.py
- Manually run the publish to testpypi workflow
- Check the publication result on testpypi
- Create a release through github 4.1. Make sure you create a new tag vX.Y.Z through the release UI 4.2. Click the "generate release notes" button in the UI to get release notes
- The 'publish to pypi' workflow should automatically run 5.1. Note this will not work if you create the release first as a draft - you have to create it immediatly
- Updated package should be available on pypi