Picterra API client
Project description
Picterra Python API Client
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')
Installation
pip install picterra
See the examples
folder for examples.
API Reference and User Guide available on Read the Docs
Development
Setup
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.
Running tests
In order to test locally, run:
pytest
Release process
- 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
- The 'publish to pypi' workflow should automatically run
- Updated package should be available on pypi
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
picterra-2.0.1.tar.gz
(23.6 kB
view details)
Built Distribution
picterra-2.0.1-py3-none-any.whl
(16.5 kB
view details)
File details
Details for the file picterra-2.0.1.tar.gz
.
File metadata
- Download URL: picterra-2.0.1.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 072cfa835075d5938837206af1e76acae9db4974227925e930f273ee7666c585 |
|
MD5 | 9599aae021a29d1ff2013d10bab4812e |
|
BLAKE2b-256 | b08fd19011f68a0bcf9b910970b336b3419c298f24f8e02ff659f993be87a33e |
File details
Details for the file picterra-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: picterra-2.0.1-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4196a17205da471ee946892f1efeb8172a1ff460a486ed75523774797a25ce4f |
|
MD5 | 368271e84a2385dcfffcc8fe2864992a |
|
BLAKE2b-256 | da5c6b29719456fcb550163cd9a945ac457bd4febd63074f6d9b5b86a47f60d7 |