Skip to main content

Picterra API client

Project description

Picterra logo

Picterra Python API Client

Tests Documentation Status PyPI - Version

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

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

  1. Bump the version number in setup.py
  2. Manually run the publish to testpypi workflow
  3. Check the publication result on testpypi
  4. Create a release through github
  5. The 'publish to pypi' workflow should automatically run
  6. 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.3.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

picterra-2.0.3-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file picterra-2.0.3.tar.gz.

File metadata

  • Download URL: picterra-2.0.3.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for picterra-2.0.3.tar.gz
Algorithm Hash digest
SHA256 e537718c9382e851931c4a79e9e0a6df7aa9f8db21abba9b9fecd0c1527193d2
MD5 427077444c0a41eec668fb6e99e4d958
BLAKE2b-256 85b04acb48ff5ae6055428c3c4c042949b2af7bc87d0f6d299d8f9ed4e53a727

See more details on using hashes here.

File details

Details for the file picterra-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: picterra-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for picterra-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 da6b2ff7f1a540f10f51f021af0ac608f19427f3275f5bc22a09ee664680c8f5
MD5 96ede9d0f597f9e4650adb2f49394d14
BLAKE2b-256 9d80a16b62d76dfd6413bd0cc1494bcd8ab1994a776744734d4e4bdb6282f7cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page