Metadata-Version: 2.4
Name: scrappi
Version: 0.3.6
Summary: EO Satellite product catalogue retrieval by API or file system
Author-email: MetEOR Toolkit Team <team@comet-toolkit.org>
Project-URL: Homepage, https://www.comet-toolkit.org/meteor/
Project-URL: Documentation, https://meteor-toolkit.github.io/scrappi/
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: processor-tools>=0.2.4
Requires-Dist: sentinelsat
Requires-Dist: eodag>=4.0.0
Requires-Dist: numpy
Requires-Dist: obsarray
Requires-Dist: cartopy
Requires-Dist: matplotlib
Requires-Dist: usgs
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-html; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: IPython; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx_rtd_theme; extra == "docs"
Requires-Dist: sphinx_book_theme; extra == "docs"
Requires-Dist: sphinx_design; extra == "docs"
Requires-Dist: sphinx_automodapi; extra == "docs"
Requires-Dist: myst_parser; extra == "docs"
Requires-Dist: IPython; extra == "docs"
Provides-Extra: earthaccess
Requires-Dist: earthaccess>=0.17.0; extra == "earthaccess"
Provides-Extra: hypernets-api
Requires-Dist: hypernets_api>=0.2.1; extra == "hypernets-api"
Provides-Extra: all
Requires-Dist: ruff; extra == "all"
Requires-Dist: mypy; extra == "all"
Requires-Dist: pre-commit; extra == "all"
Requires-Dist: pytest; extra == "all"
Requires-Dist: pytest-html; extra == "all"
Requires-Dist: pytest-cov; extra == "all"
Requires-Dist: IPython; extra == "all"
Requires-Dist: sphinx; extra == "all"
Requires-Dist: sphinx_rtd_theme; extra == "all"
Requires-Dist: sphinx_book_theme; extra == "all"
Requires-Dist: sphinx_design; extra == "all"
Requires-Dist: sphinx_automodapi; extra == "all"
Requires-Dist: myst_parser; extra == "all"
Requires-Dist: earthaccess>=0.17.0; extra == "all"
Requires-Dist: hypernets_api>=0.2.1; extra == "all"
Dynamic: license-file

# scrappi

EO Satellite product catalogue retrieval by API or file system.

`scrappi` queries Earth Observation satellite product catalogues from online
APIs (e.g. EODAG, Copernicus Data Space) and local file systems, and returns
structured product datasets ready for download or further processing.

> **Warning:** This software is in beta. Results should be used with
> caution. Please share any feedback via the issue tracker.

## Usage

### Virtual environment

It is always recommended to use a virtual environment for each Python project.
Use your preferred environment manager, or create one with:

```bash
python -m venv venv
```

Activate it on Windows with `venv\Scripts\activate`, or on macOS/Linux with
`source venv/bin/activate`.

### Installation

Install the package and its core dependencies:

```bash
pip install -e .
```

Optional extras are available depending on your use case:

```bash
pip install -e ".[dev]"    # Development tools (ruff, mypy, pytest, …)
pip install -e ".[docs]"   # Documentation build (sphinx, …)
```

### Development

Install the pre-commit hooks after cloning:

```bash
pre-commit install
```

When you commit, `ruff` will lint and format your code. If it makes
corrections the commit will be aborted so you can review the changes — just
commit again once you are happy.

Run the test suite with:

```bash
pytest
```

### Quickstart

#### Setting credentials

Most online satellite catalogues require authentication before they can be
queried for products. This can be done using the config file.

#### Perform a query

Once a suitable API has been identified for a product, use it to perform a
query:

```python
from scrappi.interface import perform_query
import datetime as dt

api_name = "eodag"
products = perform_query(
    api_name,
    {
        "collections": ["LANDSAT_C2L1"],
        "start_time": dt.datetime(2022, 1, 20, 7),
        "stop_time": dt.datetime(2022, 1, 20, 8, 30),
        "geom": {
            "latitude_minimum": 40,
            "longitude_minimum": 30,
            "latitude_maximum": 50,
            "longitude_maximum": 50,
        },
    },
)
```

#### Download an identified product

After querying, set a filesystem and download the products:

```python
from scrappi.interface import download_product, make_fs

fs = make_fs("./", organise_data=False)
products.set_fs(fs)
path_list = download_product(api_name, products)
```

Please refer to the [documentation](https://scrappi.readthedocs.io/en/latest/)
for further information.

## Compatibility

`scrappi` requires Python 3.11 or later and is tested on Python 3.11, 3.12,
and 3.13.

## Licence

`scrappi` is released under the GNU Lesser General Public License v3 (LGPLv3).
See the [LICENSE](https://github.com/meteor-toolkit/scrappi/blob/main/LICENSE) file for the full licence text.

## Authors

`scrappi` is developed and maintained by the
[MetEOR Toolkit Team](mailto:team@comet-toolkit.org).
