Metadata-Version: 2.4
Name: sen2p
Version: 0.0.4
Summary: Download Sentinel-2 data from Microsoft Planetary Computer
Home-page: https://github.com/tnmthai/sen2p
Author: Thai Tran
Author-email: ThaiTran@outlook.co.nz
License: MIT
Project-URL: Homepage, https://github.com/yourusername/sen2p
Project-URL: Issues, https://github.com/yourusername/sen2p/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: planetary-computer
Requires-Dist: pystac-client
Requires-Dist: rioxarray
Requires-Dist: xarray
Requires-Dist: tqdm
Requires-Dist: geopandas
Requires-Dist: shapely
Dynamic: author-email
Dynamic: home-page
Dynamic: requires-python

# sen2p

`sen2p` is a lightweight Python library to download Sentinel-2 imagery from Microsoft Planetary Computer.

## 🌍 Features

- 🔍 Search Sentinel-2 data by date and location (point or shapefile)
- 🛰️ Download multiple bands and/or selected bands
- 🗂️ Stack and preprocess bands into a single image
- 🐍 Easy to integrate with geospatial workflows

## 📦 Installation

```bash
pip install sen2p
```

## Usage

### Using a Point Location [lon, lat]
```python
from sen2p import download

location = [172.1, -43.5]

results = download(
    start_date="2023-06-01",
    end_date="2023-06-10",
    location=location,
    bands=["B02", "B03", "B04"],
    output_dir="test_outputs",        
)

for r in results:
    print("Downloaded:", r)
```
### Using a bounding box
```python
from sen2p import download

bbox = [172.0, -43.6, 172.5, -43.3]

results = download(
    start_date="2023-06-01",
    end_date="2023-06-10",
    location=bbox,
    bands=["B02", "B03", "B04"],
    output_dir="test_outputs",        
)
```

### Using a Polygon Shapefile
```python
from sen2p import download

# Path to your shapefile
shapefile_path = "Site.shp"  # Update with your actual shapefile path

# Call the function
results = download(
    start_date="2023-06-01",
    end_date="2023-06-30",
    location=shapefile_path,
    bands=["B02", "B03", "B04"],
    output_dir="test_output",       
)
```
### Show metadata
```python
from sen2p import show_meta
show_meta("S2B_..._merged.tif")
```
## 🔖 License

This project is licensed under the MIT License.
