Quickstart

Note

This page provides a quick reference example. For a more detailed introduction, see Getting Started. For more examples, see the Cookbook.

Peppi is meant to be simple to start with. It brings you to the core of your research in a few lines of code.

The following code has been tested with Python 3.13.

Try it

Install:

pip install pds.peppi

The following lines of code can be found in this file

Import:

from datetime import datetime
import pds.peppi as pep

Get the connection to the PDS Web API (and the underlying Registry):

client = pep.PDSRegistryClient()

Find your data, observation data of mercury before 2012-01-23: Alternate filter methods can be found in the Library Reference

date1 = datetime.fromisoformat("2012-01-23")
# mercury identifier in PDS, find it, in the type "target"
# in the `PDS keyword search <https://pds.nasa.gov/datasearch/keyword-search/search.jsp>`_
mercury_id = "urn:nasa:pds:context:target:planet.mercury"
# filter here:
products = pep.Products(client).has_target(mercury_id).before(date1).observationals()

You can even simplify the last line, selecting the target from its name, as follows:

products = pep.Products(client).has_target("mercury").before(date1).observationals()

Then iterate on the results:

for i, p in enumerate(products):
    print(p.id, p.investigations)
    # there a lot of data there, break after a couple of hundreds
    if i > 200:
        break

Numerous pre-defined filters are available, you can explore them.

Next Steps

Now that you’ve seen a quick example, explore the documentation:

  • New to Python or Peppi? Start with Getting Started for a gentle introduction

  • Want more examples? Check out the Cookbook with 20+ ready-to-use recipes

  • Need to understand concepts? Read the User Guide for comprehensive explanations

  • Looking for API details? See the full Library Reference

Additional Resources