Skip to main content

Download Sentinel-2 data from Microsoft Planetary Computer

Project description

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

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",
    merge_bands=True,
    max_items=3  # download up to 3 images
)

for r in results:
    print("Downloaded:", r)

Using a bounding box

from sen2p import download_pc_stac_item

# Example: download data for a bounding box and date range
download_pc_stac_item(
    bbox=[172.0, -43.6, 172.5, -43.3],
    start_date="2024-01-01",
    end_date="2024-01-15",
    output_dir="data"
)

Using a Polygon Shapefile

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",
    merge_bands=True,
    max_items=5  # Download up to 5 matching images
)

Show metadata

from sen2p import show_meta
show_meta("S2B_..._merged.tif")

🔖 License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sen2p-0.0.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sen2p-0.0.3-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file sen2p-0.0.3.tar.gz.

File metadata

  • Download URL: sen2p-0.0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for sen2p-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d877b660a94a4becdd2690c1271ae29eb08861eba0473810ef319263a77e7481
MD5 85d3014f58b34226dd2243ce6ef576df
BLAKE2b-256 a2e640423c7a9baf1b4948e4aaddb3c9601b57026febd8d0e7ded6a769a95688

See more details on using hashes here.

File details

Details for the file sen2p-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: sen2p-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for sen2p-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 55ab8ff896903538b58ca8ef3a4591c6a04bd62cd10ee2eef7c30ad0b2e619a7
MD5 a2ad88eaded388020373ab9c677eff08
BLAKE2b-256 e4a82382f30e503d2daa16e9a6775ceb3574bee4470349a381b3b3a7d07e29c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page