earthchange 0.1.31__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+ # Secrets / credentials
2
+ .env
3
+ scripts/config/elevenlabs.txt
4
+ scripts/config/ee-geodetic.json
5
+ scripts/config/*.json
6
+ scripts/config/*.txt
7
+ *-service-account*.json
8
+
9
+ # Raw satellite inputs (large / licensed) — keep the folder's README
10
+ data/*
11
+ !data/README.md
12
+
13
+ # Generated change-detection result images (reproduce with detect.py)
14
+ images/deforestation_*
15
+ images/mining_*
16
+ images/urbanization_*
17
+ images/urban-trend_*
18
+ images/flood_*
19
+ images/burn_*
20
+ images/water_*
21
+
22
+ # Per-run change-detection outputs (detect.py writes output/<run-id>/)
23
+ output/
24
+
25
+ # Generated map products (reproduce with detect.py --map / make_map.py)
26
+ maps/
27
+
28
+ # Large binary outputs (regenerate with scripts)
29
+ audio/
30
+ scenes/
31
+ *.mp4
32
+ *.mp3
33
+
34
+ # Temp files
35
+ /tmp/
36
+ *.pyc
37
+ __pycache__/
38
+
39
+ # macOS
40
+ .DS_Store
41
+
42
+ # Python packaging build artifacts
43
+ build/
44
+ dist/
45
+ *.egg-info/
46
+ .eggs/
47
+
48
+ # API docs are generated in CI (pdoc) and deployed by the docs workflow
49
+ docs/api/
50
+ grok_understand.md
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Firman Hadi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: earthchange
3
+ Version: 0.1.31
4
+ Summary: Multipurpose satellite change detection (deforestation, mining, urbanisation, floods, burns, water, urban growth) via Google Earth Engine or Microsoft Planetary Computer.
5
+ Project-URL: Homepage, https://github.com/firmanhadi21/rs-change-detection
6
+ Project-URL: Documentation, https://firmanhadi21.github.io/rs-change-detection/
7
+ Project-URL: Repository, https://github.com/firmanhadi21/rs-change-detection
8
+ Author-email: Firman Hadi <firmanhadi21@lecturer.undip.ac.id>
9
+ Maintainer-email: Firman Hadi <firmanhadi21@lecturer.undip.ac.id>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: change-detection,deforestation,earth-engine,flood,geospatial,gis,landsat,ndbi,ndvi,planetary-computer,remote-sensing,sentinel
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Topic :: Scientific/Engineering :: GIS
20
+ Classifier: Topic :: Scientific/Engineering :: Image Recognition
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: requests
23
+ Provides-Extra: all
24
+ Requires-Dist: contextily; extra == 'all'
25
+ Requires-Dist: earthengine-api; extra == 'all'
26
+ Requires-Dist: matplotlib; extra == 'all'
27
+ Requires-Dist: numpy; extra == 'all'
28
+ Requires-Dist: odc-stac; extra == 'all'
29
+ Requires-Dist: planetary-computer; extra == 'all'
30
+ Requires-Dist: pystac-client; extra == 'all'
31
+ Requires-Dist: rasterio; extra == 'all'
32
+ Requires-Dist: rioxarray; extra == 'all'
33
+ Provides-Extra: gee
34
+ Requires-Dist: earthengine-api; extra == 'gee'
35
+ Provides-Extra: maps
36
+ Requires-Dist: contextily; extra == 'maps'
37
+ Requires-Dist: matplotlib; extra == 'maps'
38
+ Requires-Dist: numpy; extra == 'maps'
39
+ Requires-Dist: rasterio; extra == 'maps'
40
+ Requires-Dist: scikit-image; extra == 'maps'
41
+ Requires-Dist: scipy; extra == 'maps'
42
+ Requires-Dist: shapely; extra == 'maps'
43
+ Provides-Extra: mpc
44
+ Requires-Dist: numpy; extra == 'mpc'
45
+ Requires-Dist: odc-stac; extra == 'mpc'
46
+ Requires-Dist: planetary-computer; extra == 'mpc'
47
+ Requires-Dist: pystac-client; extra == 'mpc'
48
+ Requires-Dist: rasterio; extra == 'mpc'
49
+ Requires-Dist: rioxarray; extra == 'mpc'
50
+ Provides-Extra: transit
51
+ Requires-Dist: contextily; extra == 'transit'
52
+ Requires-Dist: earthengine-api; extra == 'transit'
53
+ Requires-Dist: matplotlib; extra == 'transit'
54
+ Requires-Dist: networkx; extra == 'transit'
55
+ Requires-Dist: numpy; extra == 'transit'
56
+ Requires-Dist: rasterio; extra == 'transit'
57
+ Requires-Dist: scipy; extra == 'transit'
58
+ Requires-Dist: shapely; extra == 'transit'
59
+ Description-Content-Type: text/markdown
60
+
61
+ # earthchange
62
+
63
+ **Multipurpose satellite change detection in pure Python.** Map deforestation,
64
+ mining, urbanisation, floods, burns, surface-water change and multi-epoch urban
65
+ growth anywhere on Earth from free Sentinel-1/2 and Landsat data — via **Google
66
+ Earth Engine** or **Microsoft Planetary Computer** (no account needed). Export
67
+ georeferenced GeoTIFFs, quick-look PNGs, statistics, and print-ready A4 maps.
68
+
69
+ - 📖 **Full hands-on tutorial (English & Bahasa Indonesia):** <https://firmanhadi21.github.io/rs-change-detection/>
70
+ - 💻 **Source, examples & case study:** <https://github.com/firmanhadi21/rs-change-detection>
71
+
72
+ ## Install
73
+
74
+ Heavy dependencies are optional *extras*, so the install stays lean:
75
+
76
+ ```bash
77
+ pip install 'earthchange[gee]' # Google Earth Engine backend (free account)
78
+ pip install 'earthchange[mpc,maps]' # Planetary Computer + maps (no account)
79
+ pip install 'earthchange[all]' # everything
80
+ ```
81
+
82
+ ## Quick start
83
+
84
+ ```bash
85
+ # Deforestation around a coordinate, with a finished map
86
+ earthchange -s deforestation --lat -3.333 --lon 122.25 --radius 6 --map
87
+
88
+ # Flood extent from Sentinel-1 SAR — no Earth Engine account needed
89
+ earthchange -s flood --lat 27.2 --lon 68.3 \
90
+ --pre 2022-07-01:2022-07-25 --post 2022-08-20:2022-09-10 --backend mpc
91
+
92
+ # Urban growth timing across 2010/2015/2020 (Landsat 5/8/9)
93
+ earthchange -s urban-trend --lat -6.30 --lon 107.15 --map
94
+
95
+ # List everything
96
+ earthchange --list
97
+ ```
98
+
99
+ Each run writes a self-contained `output/<run-id>/` folder containing the PNG,
100
+ GeoTIFF, statistics JSON, metadata, and any maps.
101
+
102
+ ## Scenarios
103
+
104
+ | Scenario | Method | Sensor |
105
+ |----------|--------|--------|
106
+ | `deforestation` | NDVI loss | Sentinel-2 |
107
+ | `urbanization` | Built-up gain — `NDBI` (default), `UI`, `BU`, `IBI`, or thermal `NDISI`/`EBBI` via `--method` | Sentinel-2 / Landsat |
108
+ | `water` | NDWI change | Sentinel-2 |
109
+ | `burn` | dNBR severity | Sentinel-2 |
110
+ | `mining` | SIRAD radar temporal + NDVI loss | Sentinel-1 + S2 |
111
+ | `flood` | SAR water extent (event vs baseline) | Sentinel-1 |
112
+ | `urban-trend` | NDBI at 3 epochs → RGB growth-timing map | Landsat 5/8/9 |
113
+ | `coastline` | Sea boundary + shoreline change (erosion/accretion) + retreat rate m/yr | S1 / S2 / Landsat |
114
+ | `transit-access` | % population with access to public transport (SDG 11.2.1) | WorldPop + OSM |
115
+ | `island-heat` | SST + LST + wet-bulb (humid heat) trends for small islands | OISST / Landsat / ERA5 |
116
+ | `urban-heat` | Urban heat island (SUHII) + hot-spot map + decadal trend | GHSL + Landsat + MODIS |
117
+
118
+ ## Two backends
119
+
120
+ | `--backend` | Data source | Account? |
121
+ |-------------|-------------|----------|
122
+ | `gee` (default) | Google Earth Engine | free account + `earthengine authenticate` |
123
+ | `mpc` | Microsoft Planetary Computer (STAC) | **none** — streams COGs, processes locally |
124
+
125
+ Optical scenarios build cloud-masked median composites; radar scenarios
126
+ auto-select the Sentinel-1 orbit with coverage. The AOI is a square centred on
127
+ your coordinate. Landsat 7 is skipped (SLC-off gaps).
128
+
129
+ ## Make maps from a finished run
130
+
131
+ ```bash
132
+ earthmap output/<run-id> # render A4 map sheets offline (no GEE)
133
+ ```
134
+
135
+ Map sheets include an OpenStreetMap basemap, the change layer, legend, a
136
+ statistics panel, a location inset, coordinate grid, scale bar and north arrow.
137
+
138
+ ## License
139
+
140
+ MIT © Firman Hadi. Data: Copernicus Sentinel (ESA) and Landsat (USGS/NASA),
141
+ via Google Earth Engine or Microsoft Planetary Computer.
@@ -0,0 +1,79 @@
1
+ # Publishing `earthchange` to PyPI
2
+
3
+ The package lives in [`earthchange/`](earthchange/) and is configured by
4
+ [`pyproject.toml`](pyproject.toml). These steps build and upload it. **Nothing
5
+ here uploads automatically** — you run the final step with your own PyPI token.
6
+
7
+ ## 0. One-time prerequisites
8
+
9
+ ```bash
10
+ pip install --upgrade build twine
11
+ ```
12
+
13
+ - Create accounts on **[TestPyPI](https://test.pypi.org/)** and **[PyPI](https://pypi.org/)**.
14
+ - Create an **API token** for each (Account → API tokens). You'll paste it as the
15
+ password with username `__token__`.
16
+ - **Check the name is free:** https://pypi.org/project/earthchange/ must 404.
17
+ If taken, change `name = "..."` in `pyproject.toml` (the import package
18
+ `earthchange/` can keep its name, but the PyPI distribution name must be unique).
19
+
20
+ ## 1. Build the distributions
21
+
22
+ ```bash
23
+ python -m build # writes dist/earthchange-0.1.0.tar.gz and .whl
24
+ python -m twine check dist/*
25
+ ```
26
+
27
+ ## 2. Test on TestPyPI first
28
+
29
+ ```bash
30
+ python -m twine upload --repository testpypi dist/*
31
+ # then try installing it in a clean venv:
32
+ pip install --index-url https://test.pypi.org/simple/ \
33
+ --extra-index-url https://pypi.org/simple 'earthchange[all]'
34
+ earthchange --list
35
+ ```
36
+
37
+ ## 3. Upload to the real PyPI
38
+
39
+ ```bash
40
+ python -m twine upload dist/*
41
+ ```
42
+
43
+ Then anyone can:
44
+
45
+ ```bash
46
+ pip install 'earthchange[gee]' # Earth Engine backend
47
+ pip install 'earthchange[mpc,maps]' # Planetary Computer + maps, no GEE account
48
+ pip install 'earthchange[all]' # everything
49
+ earthchange -s deforestation --lat -3.333 --lon 122.25 --map
50
+ ```
51
+
52
+ ## Cutting a new version
53
+
54
+ 1. Bump `version` in `pyproject.toml` (PyPI versions are immutable — you can't
55
+ re-upload the same one).
56
+ 2. Rebuild (`rm -rf dist && python -m build`) and re-upload.
57
+ 3. Tag the release: `git tag v0.1.0 && git push --tags`.
58
+
59
+ ## Regenerating the API docs
60
+
61
+ The API reference under `docs/api/` is generated from the docstrings with
62
+ [pdoc](https://pdoc.dev) and served by GitHub Pages at `…/rs-change-detection/api/`.
63
+ Rebuild it after changing public functions/docstrings:
64
+
65
+ ```bash
66
+ pip install pdoc
67
+ pdoc earthchange -o docs/api # needs the package importable (pip install -e .)
68
+ git add docs/api && git commit -m "docs: regenerate API reference"
69
+ ```
70
+
71
+ ## Notes
72
+
73
+ - **Extras** keep the install lean: core is tiny (`requests`); `gee`, `mpc`,
74
+ `maps` pull only what that path needs.
75
+ - The Capkala investigation (`data-collection/`, `scripts/`, `narration/`,
76
+ `images/`) is **not** shipped in the wheel — only the `earthchange/` package is.
77
+ - Outputs are written to `./output/<run-id>/` in the current directory, and the
78
+ GEE service-account key (if used) is read from `./scripts/config/ee-geodetic.json`
79
+ or `~/.config/earthengine/` — never bundled.
@@ -0,0 +1,81 @@
1
+ # earthchange
2
+
3
+ **Multipurpose satellite change detection in pure Python.** Map deforestation,
4
+ mining, urbanisation, floods, burns, surface-water change and multi-epoch urban
5
+ growth anywhere on Earth from free Sentinel-1/2 and Landsat data — via **Google
6
+ Earth Engine** or **Microsoft Planetary Computer** (no account needed). Export
7
+ georeferenced GeoTIFFs, quick-look PNGs, statistics, and print-ready A4 maps.
8
+
9
+ - 📖 **Full hands-on tutorial (English & Bahasa Indonesia):** <https://firmanhadi21.github.io/rs-change-detection/>
10
+ - 💻 **Source, examples & case study:** <https://github.com/firmanhadi21/rs-change-detection>
11
+
12
+ ## Install
13
+
14
+ Heavy dependencies are optional *extras*, so the install stays lean:
15
+
16
+ ```bash
17
+ pip install 'earthchange[gee]' # Google Earth Engine backend (free account)
18
+ pip install 'earthchange[mpc,maps]' # Planetary Computer + maps (no account)
19
+ pip install 'earthchange[all]' # everything
20
+ ```
21
+
22
+ ## Quick start
23
+
24
+ ```bash
25
+ # Deforestation around a coordinate, with a finished map
26
+ earthchange -s deforestation --lat -3.333 --lon 122.25 --radius 6 --map
27
+
28
+ # Flood extent from Sentinel-1 SAR — no Earth Engine account needed
29
+ earthchange -s flood --lat 27.2 --lon 68.3 \
30
+ --pre 2022-07-01:2022-07-25 --post 2022-08-20:2022-09-10 --backend mpc
31
+
32
+ # Urban growth timing across 2010/2015/2020 (Landsat 5/8/9)
33
+ earthchange -s urban-trend --lat -6.30 --lon 107.15 --map
34
+
35
+ # List everything
36
+ earthchange --list
37
+ ```
38
+
39
+ Each run writes a self-contained `output/<run-id>/` folder containing the PNG,
40
+ GeoTIFF, statistics JSON, metadata, and any maps.
41
+
42
+ ## Scenarios
43
+
44
+ | Scenario | Method | Sensor |
45
+ |----------|--------|--------|
46
+ | `deforestation` | NDVI loss | Sentinel-2 |
47
+ | `urbanization` | Built-up gain — `NDBI` (default), `UI`, `BU`, `IBI`, or thermal `NDISI`/`EBBI` via `--method` | Sentinel-2 / Landsat |
48
+ | `water` | NDWI change | Sentinel-2 |
49
+ | `burn` | dNBR severity | Sentinel-2 |
50
+ | `mining` | SIRAD radar temporal + NDVI loss | Sentinel-1 + S2 |
51
+ | `flood` | SAR water extent (event vs baseline) | Sentinel-1 |
52
+ | `urban-trend` | NDBI at 3 epochs → RGB growth-timing map | Landsat 5/8/9 |
53
+ | `coastline` | Sea boundary + shoreline change (erosion/accretion) + retreat rate m/yr | S1 / S2 / Landsat |
54
+ | `transit-access` | % population with access to public transport (SDG 11.2.1) | WorldPop + OSM |
55
+ | `island-heat` | SST + LST + wet-bulb (humid heat) trends for small islands | OISST / Landsat / ERA5 |
56
+ | `urban-heat` | Urban heat island (SUHII) + hot-spot map + decadal trend | GHSL + Landsat + MODIS |
57
+
58
+ ## Two backends
59
+
60
+ | `--backend` | Data source | Account? |
61
+ |-------------|-------------|----------|
62
+ | `gee` (default) | Google Earth Engine | free account + `earthengine authenticate` |
63
+ | `mpc` | Microsoft Planetary Computer (STAC) | **none** — streams COGs, processes locally |
64
+
65
+ Optical scenarios build cloud-masked median composites; radar scenarios
66
+ auto-select the Sentinel-1 orbit with coverage. The AOI is a square centred on
67
+ your coordinate. Landsat 7 is skipped (SLC-off gaps).
68
+
69
+ ## Make maps from a finished run
70
+
71
+ ```bash
72
+ earthmap output/<run-id> # render A4 map sheets offline (no GEE)
73
+ ```
74
+
75
+ Map sheets include an OpenStreetMap basemap, the change layer, legend, a
76
+ statistics panel, a location inset, coordinate grid, scale bar and north arrow.
77
+
78
+ ## License
79
+
80
+ MIT © Firman Hadi. Data: Copernicus Sentinel (ESA) and Landsat (USGS/NASA),
81
+ via Google Earth Engine or Microsoft Planetary Computer.