Metadata-Version: 2.4
Name: rogerpy
Version: 0.1.0
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 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`.

### 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")
```

### Custom host

Both clients default to `host="https://mosaic.ethz.ch"`. Point at a different
deployment (e.g. a local dev server) with:

```python
mosaic = MosaicClient(host="http://localhost:8000")
```

## 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.
