Setting up a Python development environment

last updated: August 29, 2024

Development Environment Setup

The Basics

The following tools are regularly used in Planet School's guides:

If you choose to follow along with code here, you may find it useful to install these libraries in your development environment:

$ pip install requests
$ pip install retrying
$ pip install jq

# Requires Node.js
$ npm install -g geojsonio-cli

For convenience, some examples here may pipe JSON API output to jq and filter for a specific field. You may prefer to remove the jq filter in order to familiarize yourself with the complete API objects.

Working with Planet Data

When working with datasets like Planet's satellite imagery, here are a few useful Python libraries to know:

Rasterio is a free and open source library for working with geospatial raster imagery. Rasterio is used extensively in the Python code that you'll find through Planet School, as well as in most Jupyter Notebooks in Planet's open source Notebook collection.

Fiona is a sibling library to Rasterio used when working with geospatial vector data. While less frequently used in Planet's developer resources, Fiona can still come in handy when, for example, creating or manipulating an AOI (Area of Interest) vector dataset.

NumPy and MatPlotLib can be used to manipulate, plot, and display raster data that has been loaded via Rasterio.

Installing Planet's Python client library and CLI

Most Python-savvy users find Planet's Python client (import planet) a convenient way to incorporate Planet API into new and existing Python workflows.

Additionally, the Planet CLI (command-line interface) is used widely, and you'll find it referenced frequently in Planet School and throughout our Notebook collection.

To install both the Python client library and CLI in your development environment:

$ pip install planet

Note: if you want to use the Planet CLI outside of your development environment, you may instead prefer to do:

$pip install --user planet

For complete documentation as well as usage examples, see the docs here.


Rate this guide: