Metadata-Version: 2.4
Name: rogerpy
Version: 0.1.1
Summary: Query geopoint and sample data from the MOSAIC and Fractal REST APIs
Author-email: Sarah Paradis <sarah.paradisvilar@gmail.com>
License: MIT
Project-URL: Homepage, https://mosaic.ethz.ch
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: pandas
Dynamic: license-file

# rogerpy

A lightweight Python client for querying geopoint and sample data from the
[MOSAIC](https://mosaic.ethz.ch) and [FRACTAL](https://fractal.ethz.ch) REST APIs.

## Install

```bash
pip install rogerpy
```

## Usage

```python
from rogerpy import MosaicClient, FractalClient

mosaic = MosaicClient()
geopoints = mosaic.geopoints()          # standard published dataset (db_version="r2")
samples = mosaic.samples(analyses="TOC,TN", water_depth="0,200")

fractal = FractalClient()
geopoints = fractal.geopoints()         # standard published dataset (db_version="r1")
```

Both `geopoints()` and `samples()` return a `pandas.DataFrame`.

### Choosing a database version

Both methods accept an optional `db_version` argument. If omitted, they
default to the standard published dataset for that client (`"r2"` for
`MosaicClient`, `"r1"` for `FractalClient`):

```python
mosaic = MosaicClient()
mosaic.geopoints()                    # same as db_version="r2"
mosaic.geopoints(db_version="r2")     # explicit
```

### Querying a dev database

The standard ("std") database versions are public. Querying a "-dev" version
requires an authenticated session:

```python
mosaic = MosaicClient()
mosaic.login(username="...", password="...")
geopoints = mosaic.geopoints(db_version="r2-dev")
```

## Scope

`rogerpy` only covers the read/query endpoints (`geopoints`, `samples`, and a
generic `get()` for any other GET endpoint). It does not include data upload
or admin functionality.
