geomoz 0.1.0__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.
- geomoz-0.1.0/.gitignore +65 -0
- geomoz-0.1.0/.gitignore.save +65 -0
- geomoz-0.1.0/MANIFEST.in +19 -0
- geomoz-0.1.0/MANIFEST_old.in +17 -0
- geomoz-0.1.0/PKG-INFO +158 -0
- geomoz-0.1.0/PUBLISH_GUIDE.md +270 -0
- geomoz-0.1.0/PUBLISH_SUMMARY.md +234 -0
- geomoz-0.1.0/QUICK_REFERENCE.md +409 -0
- geomoz-0.1.0/README.md +119 -0
- geomoz-0.1.0/README_COMPREHENSIVE.md +633 -0
- geomoz-0.1.0/README_MAPPING.md +144 -0
- geomoz-0.1.0/README_PYPI.md +299 -0
- geomoz-0.1.0/TUTORIAL.md +644 -0
- geomoz-0.1.0/all_layers_map.py +246 -0
- geomoz-0.1.0/build_and_publish.py +230 -0
- geomoz-0.1.0/complete_geology_map.py +197 -0
- geomoz-0.1.0/example_geomoz.py +86 -0
- geomoz-0.1.0/examples//033[200~05_geological_ed.py +1 -0
- geomoz-0.1.0/examples/01_basic_geological_map.py +162 -0
- geomoz-0.1.0/examples/01_provinces_mozambique.png +0 -0
- geomoz-0.1.0/examples/02_geologic_map_province.py +105 -0
- geomoz-0.1.0/examples/03_geologic_map_district.py +125 -0
- geomoz-0.1.0/examples/03_mining_integration.py +327 -0
- geomoz-0.1.0/examples/04_web_map_interactive_maputo.py +306 -0
- geomoz-0.1.0/examples/05_administrative_boundaries.py +409 -0
- geomoz-0.1.0/examples/05_geological_analysis_advanced.py +303 -0
- geomoz-0.1.0/examples/06_complete_geologist_tutorial.py +218 -0
- geomoz-0.1.0/examples/06_detailed_villages.py +341 -0
- geomoz-0.1.0/examples/07_plot_utils_demo.py +272 -0
- geomoz-0.1.0/examples/08_cache_demo.py +56 -0
- geomoz-0.1.0/examples/README_EXAMPLES.md +239 -0
- geomoz-0.1.0/examples/grafico_litologias.png +0 -0
- geomoz-0.1.0/examples/mapa_era_profissional.png +0 -0
- geomoz-0.1.0/examples/mapa_geologico_distrital_Mocuba.png +0 -0
- geomoz-0.1.0/examples/mapa_geologico_tete_code2006.png +0 -0
- geomoz-0.1.0/examples/mapa_interativo_maputo.html +21166 -0
- geomoz-0.1.0/examples/mapa_maputo_legend.html +21261 -0
- geomoz-0.1.0/examples/mozambique_geological_correlation_analysis.png +0 -0
- geomoz-0.1.0/examples/mozambique_geological_map_correct.png +0 -0
- geomoz-0.1.0/examples/step1_basic.png +0 -0
- geomoz-0.1.0/examples/step2_spatial.png +0 -0
- geomoz-0.1.0/examples/step3_mining.png +0 -0
- geomoz-0.1.0/examples/step4_research.png +0 -0
- geomoz-0.1.0/geology_map_zambezia.py +152 -0
- geomoz-0.1.0/geology_zambezia_teste2.png +0 -0
- geomoz-0.1.0/geomoz/__init__.py +83 -0
- geomoz-0.1.0/geomoz/core.py +110 -0
- geomoz-0.1.0/geomoz/list_geomoz.py +93 -0
- geomoz-0.1.0/geomoz/plot_utils.py +578 -0
- geomoz-0.1.0/geomoz/read_admin_post.py +116 -0
- geomoz-0.1.0/geomoz/read_admin_post_old.py +164 -0
- geomoz-0.1.0/geomoz/read_district.py +114 -0
- geomoz-0.1.0/geomoz/read_district_old.py +167 -0
- geomoz-0.1.0/geomoz/read_geology.py +185 -0
- geomoz-0.1.0/geomoz/read_geology_old.py +190 -0
- geomoz-0.1.0/geomoz/read_province.py +112 -0
- geomoz-0.1.0/geomoz/read_province_old.py +141 -0
- geomoz-0.1.0/geomoz/read_village.py +118 -0
- geomoz-0.1.0/geomoz/read_village_old.py +164 -0
- geomoz-0.1.0/geomoz/spatial.py +682 -0
- geomoz-0.1.0/geomoz/utils/__init__.py +45 -0
- geomoz-0.1.0/geomoz/utils/__init___old.py +32 -0
- geomoz-0.1.0/geomoz/utils/cache.py +276 -0
- geomoz-0.1.0/geomoz/utils/data.py +266 -0
- geomoz-0.1.0/geomoz/utils/utils.py +220 -0
- geomoz-0.1.0/geomoz/utils.py +312 -0
- geomoz-0.1.0/mozambique_utm_zones.png +0 -0
- geomoz-0.1.0/pyproject.toml +74 -0
- geomoz-0.1.0/requirements.txt +22 -0
- geomoz-0.1.0/requirements_old.txt +3 -0
- geomoz-0.1.0/robust_geology_map.py +177 -0
- geomoz-0.1.0/simple_all_layers.py +126 -0
- geomoz-0.1.0/simple_geology_map.py +81 -0
- geomoz-0.1.0/test_geomoz_manual.py +65 -0
- geomoz-0.1.0/test_hf_simple.py +79 -0
- geomoz-0.1.0/test_huggingface.py +202 -0
- geomoz-0.1.0/test_notebook.py +51 -0
- geomoz-0.1.0/test_real_installation.py +259 -0
- geomoz-0.1.0/teste2.py +135 -0
- geomoz-0.1.0/teste2_simples.py +90 -0
- geomoz-0.1.0/tests/README_TESTS.md +124 -0
- geomoz-0.1.0/tests/check_cross_zone.py +128 -0
- geomoz-0.1.0/tests/crs_auto_example.py +69 -0
- geomoz-0.1.0/tests/distritos_maputo_prov/303/255ncia.png +0 -0
- geomoz-0.1.0/tests/distritos_nampula.png +0 -0
- geomoz-0.1.0/tests/distritos_zamb/303/251zia.png +0 -0
- geomoz-0.1.0/tests/final_demo_simple.py +126 -0
- geomoz-0.1.0/tests/mozambique_pais.png +0 -0
- geomoz-0.1.0/tests/postos_maputo_prov/303/255ncia.png +0 -0
- geomoz-0.1.0/tests/postos_zamb/303/251zia.png +0 -0
- geomoz-0.1.0/tests/provincia_cabo_delgado.png +0 -0
- geomoz-0.1.0/tests/provincia_gaza.png +0 -0
- geomoz-0.1.0/tests/provincia_inhambane.png +0 -0
- geomoz-0.1.0/tests/provincia_manica.png +0 -0
- geomoz-0.1.0/tests/provincia_maputo_prov/303/255ncia.png +0 -0
- geomoz-0.1.0/tests/provincia_nampula.png +0 -0
- geomoz-0.1.0/tests/provincia_niassa.png +0 -0
- geomoz-0.1.0/tests/provincia_sofala.png +0 -0
- geomoz-0.1.0/tests/provincia_tete.png +0 -0
- geomoz-0.1.0/tests/provincia_zamb/303/251zia.png +0 -0
- geomoz-0.1.0/tests/relatorio_completo.txt +83 -0
- geomoz-0.1.0/tests/reobustez.py +200 -0
- geomoz-0.1.0/tests/resumo_testes.txt +17 -0
- geomoz-0.1.0/tests/run_all_tests.py +194 -0
- geomoz-0.1.0/tests/test_cross_zone_robust.py +143 -0
- geomoz-0.1.0/tests/test_geomoz.py +71 -0
- geomoz-0.1.0/tests/test_mozambique_complete.py +301 -0
- geomoz-0.1.0/tests/utm_zones_demo.py +93 -0
- geomoz-0.1.0/yah.txt +1 -0
geomoz-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
venv/
|
|
25
|
+
env/
|
|
26
|
+
ENV/
|
|
27
|
+
|
|
28
|
+
# IDEs
|
|
29
|
+
.vscode/
|
|
30
|
+
.idea/
|
|
31
|
+
*.swp
|
|
32
|
+
*.swo
|
|
33
|
+
*~
|
|
34
|
+
|
|
35
|
+
# Jupyter Notebook
|
|
36
|
+
.ipynb_checkpoints
|
|
37
|
+
|
|
38
|
+
# Cache
|
|
39
|
+
.cache/
|
|
40
|
+
*.pkl
|
|
41
|
+
.pytest_cache/
|
|
42
|
+
|
|
43
|
+
# OS
|
|
44
|
+
.DS_Store
|
|
45
|
+
Thumbs.db
|
|
46
|
+
|
|
47
|
+
# Dados locais (podem ser grandes)
|
|
48
|
+
*.gpkg
|
|
49
|
+
*.shp
|
|
50
|
+
*.shx
|
|
51
|
+
*.dbf
|
|
52
|
+
*.prj
|
|
53
|
+
*.zip
|
|
54
|
+
data/
|
|
55
|
+
|
|
56
|
+
# Logs
|
|
57
|
+
*.log
|
|
58
|
+
|
|
59
|
+
# Test outputs
|
|
60
|
+
test_output/
|
|
61
|
+
coverage/
|
|
62
|
+
htmlcov/
|
|
63
|
+
|
|
64
|
+
# GeoMoz cache
|
|
65
|
+
.geomoz_cache/
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
venv/
|
|
25
|
+
env/
|
|
26
|
+
ENV/
|
|
27
|
+
|
|
28
|
+
# IDEs
|
|
29
|
+
.vscode/
|
|
30
|
+
.idea/
|
|
31
|
+
*.swp
|
|
32
|
+
*.swo
|
|
33
|
+
*~
|
|
34
|
+
|
|
35
|
+
# Jupyter Notebook
|
|
36
|
+
.ipynb_checkpoints
|
|
37
|
+
|
|
38
|
+
# Cache
|
|
39
|
+
.cache/
|
|
40
|
+
*.pkl
|
|
41
|
+
.pytest_cache/
|
|
42
|
+
|
|
43
|
+
# OS
|
|
44
|
+
.DS_Store
|
|
45
|
+
Thumbs.db
|
|
46
|
+
|
|
47
|
+
# Dados locais (podem ser grandes)
|
|
48
|
+
*.gpkg
|
|
49
|
+
*.shp
|
|
50
|
+
*.shx
|
|
51
|
+
*.dbf
|
|
52
|
+
*.prj
|
|
53
|
+
*.zip
|
|
54
|
+
data/
|
|
55
|
+
|
|
56
|
+
# Logs
|
|
57
|
+
*.log
|
|
58
|
+
|
|
59
|
+
# Test outputs
|
|
60
|
+
test_output/
|
|
61
|
+
coverage/
|
|
62
|
+
htmlcov/
|
|
63
|
+
|
|
64
|
+
# GeoMoz cache
|
|
65
|
+
.geomoz_cache/
|
geomoz-0.1.0/MANIFEST.in
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include README_PYPI.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
include pyproject.toml
|
|
5
|
+
include requirements.txt
|
|
6
|
+
recursive-include geomoz/data/*.md
|
|
7
|
+
recursive-include geomoz/utils/*.py
|
|
8
|
+
recursive-exclude *.pyc
|
|
9
|
+
recursive-exclude __pycache__
|
|
10
|
+
recursive-exclude .git*
|
|
11
|
+
recursive-exclude data/*.gpkg
|
|
12
|
+
recursive-exclude *.gpkg
|
|
13
|
+
recursive-exclude tests/*
|
|
14
|
+
recursive-exclude *_old.py
|
|
15
|
+
recursive-exclude *_new.py
|
|
16
|
+
recursive-exclude build/*
|
|
17
|
+
recursive-exclude dist/*
|
|
18
|
+
recursive-exclude *.egg-info
|
|
19
|
+
recursive-exclude __pycache__
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include README_PYPI.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
include pyproject.toml
|
|
5
|
+
include requirements.txt
|
|
6
|
+
recursive-include geomoz/data/*.md
|
|
7
|
+
recursive-include geomoz/utils/*.py
|
|
8
|
+
recursive-exclude *.pyc
|
|
9
|
+
recursive-exclude __pycache__
|
|
10
|
+
recursive-exclude .git*
|
|
11
|
+
recursive-exclude data/*.gpkg
|
|
12
|
+
recursive-exclude tests/*
|
|
13
|
+
recursive-exclude *_old.py
|
|
14
|
+
recursive-exclude *_new.py
|
|
15
|
+
recursive-exclude build/*
|
|
16
|
+
recursive-exclude dist/*
|
|
17
|
+
recursive-exclude *.egg-info
|
geomoz-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: geomoz
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Geospatial data library for Mozambique with geological and administrative datasets
|
|
5
|
+
Project-URL: Homepage, https://geolithica.com
|
|
6
|
+
Project-URL: Repository, https://github.com/geolithicamz-hub/geomoz
|
|
7
|
+
Project-URL: Documentation, https://github.com/geolithicamz-hub/geomoz/blob/main/README.md
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/geolithicamz-hub/geomoz/issues
|
|
9
|
+
Author-email: Hélder Gonçalves Félix Traquinho <heltrakinho@gmail.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
Keywords: africa,geology,geopandas,geospatial,gis,mozambique,spatial-data
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
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: Topic :: Scientific/Engineering :: GIS
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Requires-Dist: geopandas>=0.14.0
|
|
21
|
+
Requires-Dist: huggingface-hub>=0.10.0
|
|
22
|
+
Requires-Dist: pandas>=1.5.0
|
|
23
|
+
Requires-Dist: requests>=2.25.0
|
|
24
|
+
Requires-Dist: shapely>=2.0.0
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: black>=22.0.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: build>=0.7.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: flake8>=5.0.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: twine>=4.0.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: wheel>=0.37.0; extra == 'dev'
|
|
33
|
+
Provides-Extra: viz
|
|
34
|
+
Requires-Dist: contextily>=1.2.0; extra == 'viz'
|
|
35
|
+
Requires-Dist: folium>=0.12.0; extra == 'viz'
|
|
36
|
+
Requires-Dist: matplotlib>=3.5.0; extra == 'viz'
|
|
37
|
+
Requires-Dist: seaborn>=0.11.0; extra == 'viz'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# GeoMoz - Dados Geográficos de Moçambique
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<img src="https://img.shields.io/badge/version-0.1.0-blue.svg" alt="Version">
|
|
44
|
+
<img src="https://img.shields.io/badge/python-3.8%2B-blue.svg" alt="Python">
|
|
45
|
+
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License">
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
**GeoMoz** é um pacote Python que fornece acesso fácil a dados geográficos de Moçambique, incluindo divisões administrativas (11 províncias, 161 distritos, 459 postos, 11.524 aldeias) e dados geológicos completos.
|
|
49
|
+
|
|
50
|
+
Inspirado no [`geobr`](https://github.com/ipeaGIT/geobr) (Brasil).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 🚀 Instalação
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install geomoz
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Com dependências completas:
|
|
61
|
+
```bash
|
|
62
|
+
pip install geomoz geopandas matplotlib folium
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## ⚡ Uso Rápido
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
import geomoz
|
|
71
|
+
from geomoz import quick_map
|
|
72
|
+
|
|
73
|
+
# Carregar províncias
|
|
74
|
+
provinces = geomoz.read_province()
|
|
75
|
+
print(f"✅ {len(provinces)} províncias carregadas")
|
|
76
|
+
|
|
77
|
+
# Mapa rápido
|
|
78
|
+
quick_map(provinces, column='Provincia')
|
|
79
|
+
|
|
80
|
+
# Hierarquia completa
|
|
81
|
+
districts = geomoz.read_district()
|
|
82
|
+
posts = geomoz.read_admin_post()
|
|
83
|
+
villages = geomoz.read_village() # Usar cache para aldeias!
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 📊 Dados Disponíveis
|
|
89
|
+
|
|
90
|
+
| Dataset | Registros | Função |
|
|
91
|
+
|---------|-----------|--------|
|
|
92
|
+
| **Províncias** | 11 | `read_province()` |
|
|
93
|
+
| **Distritos** | 161 | `read_district()` |
|
|
94
|
+
| **Postos Administrativos** | 459 | `read_admin_post()` |
|
|
95
|
+
| **Aldeias** | 11.524 | `read_village()` / `CachedGeoMoz.read_village()` |
|
|
96
|
+
| **Geologia** | ~50.000 | `read_geology()` |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 🎨 Exemplos
|
|
101
|
+
|
|
102
|
+
### Mapa de Províncias
|
|
103
|
+
```python
|
|
104
|
+
from geomoz import plot_provinces
|
|
105
|
+
plot_provinces(show_names=True, save_path='mapa.png')
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Geologia por Província
|
|
109
|
+
```python
|
|
110
|
+
import geopandas as gpd
|
|
111
|
+
from geomoz import read_province, read_geology
|
|
112
|
+
|
|
113
|
+
province = read_province(name_province="Tete")
|
|
114
|
+
geology = read_geology()
|
|
115
|
+
geo_tete = gpd.overlay(geology, province, how='intersection')
|
|
116
|
+
print(f"Unidades geológicas em Tete: {len(geo_tete)}")
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Mapa Web Interativo
|
|
120
|
+
```python
|
|
121
|
+
import folium
|
|
122
|
+
from geomoz import read_province
|
|
123
|
+
|
|
124
|
+
province = read_province(name_province="Nampula")
|
|
125
|
+
m = folium.Map(location=[-14.5, 39], zoom_start=7)
|
|
126
|
+
folium.GeoJson(province).add_to(m)
|
|
127
|
+
m.save('mapa.html')
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 📚 Documentação
|
|
133
|
+
|
|
134
|
+
- **📖 [README Completo](README_COMPREHENSIVE.md)** - Documentação detalhada
|
|
135
|
+
- **🎓 [Tutorial Educativo](TUTORIAL.md)** - Guia passo a passo
|
|
136
|
+
- **📋 [Referência Rápida](QUICK_REFERENCE.md)** - Cheat sheet
|
|
137
|
+
- **💻 [Exemplos](examples/)** - Códigos de exemplo
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 🛠️ Desenvolvimento
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
git clone https://github.com/geolithica/geomoz.git
|
|
145
|
+
cd geomoz
|
|
146
|
+
pip install -e ".[dev]"
|
|
147
|
+
pytest
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 📄 Licença
|
|
153
|
+
|
|
154
|
+
MIT License - veja [LICENSE](LICENSE)
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
**GeoMoz** - Dados geográficos de Moçambique ao alcance de todos! 🗺️🇲🇿
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# 🚀 GeoMoz PyPI Publication Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how to publish the GeoMoz package to PyPI for global distribution.
|
|
4
|
+
|
|
5
|
+
## 📋 Prerequisites
|
|
6
|
+
|
|
7
|
+
### Required Accounts
|
|
8
|
+
1. **PyPI Account**: Register at https://pypi.org/account/register/
|
|
9
|
+
2. **GitHub Access**: Push access to geolithicamz/geomoz repository
|
|
10
|
+
3. **Hugging Face**: Dataset already published at geolithicamz/geomoz-data
|
|
11
|
+
|
|
12
|
+
### Required Tools
|
|
13
|
+
```bash
|
|
14
|
+
pip install build twine wheel
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 🔧 Package Structure
|
|
18
|
+
|
|
19
|
+
The package is properly structured for PyPI:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
geomoz/
|
|
23
|
+
├── geomoz/ # Main package
|
|
24
|
+
│ ├── __init__.py # Package initialization
|
|
25
|
+
│ ├── read_*.py # Data reading functions
|
|
26
|
+
│ ├── spatial.py # Spatial operations
|
|
27
|
+
│ ├── core.py # Core functionality
|
|
28
|
+
│ └── utils/ # Utilities
|
|
29
|
+
│ ├── __init__.py
|
|
30
|
+
│ ├── data.py # Hugging Face integration
|
|
31
|
+
│ └── utils.py # Legacy utilities
|
|
32
|
+
├── setup.py # Legacy setup
|
|
33
|
+
├── pyproject.toml # Modern build config
|
|
34
|
+
├── requirements.txt # Dependencies
|
|
35
|
+
├── MANIFEST.in # Package manifest
|
|
36
|
+
├── LICENSE # MIT License
|
|
37
|
+
├── README.md # Main documentation
|
|
38
|
+
├── README_PYPI.md # PyPI-specific README
|
|
39
|
+
└── build_and_publish.py # Build/publish script
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 🏗️ Build Process
|
|
43
|
+
|
|
44
|
+
### 1. Clean Previous Builds
|
|
45
|
+
```bash
|
|
46
|
+
python build_and_publish.py build
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. Test Installation
|
|
50
|
+
```bash
|
|
51
|
+
python build_and_publish.py test
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 3. Build Distribution Files
|
|
55
|
+
```bash
|
|
56
|
+
python build_and_publish.py build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 📦 Distribution Files
|
|
60
|
+
|
|
61
|
+
After building, you'll find:
|
|
62
|
+
- `dist/geomoz-1.0.0-py3-none-any.whl` - Wheel distribution
|
|
63
|
+
- `dist/geomoz-1.0.0.tar.gz` - Source distribution
|
|
64
|
+
|
|
65
|
+
## 🚀 Publishing to PyPI
|
|
66
|
+
|
|
67
|
+
### Test Publication (Recommended)
|
|
68
|
+
```bash
|
|
69
|
+
python build_and_publish.py testpypi
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Production Publication
|
|
73
|
+
```bash
|
|
74
|
+
python build_and_publish.py pypi
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## 🔐 Authentication
|
|
78
|
+
|
|
79
|
+
### Method 1: API Token (Recommended)
|
|
80
|
+
1. Generate PyPI API token at https://pypi.org/manage/account/token/
|
|
81
|
+
2. Set environment variable:
|
|
82
|
+
```bash
|
|
83
|
+
export TWINE_PASSWORD=pypi-xxxxxx
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Method 2: Username/Password
|
|
87
|
+
```bash
|
|
88
|
+
twine upload dist/* -u __username__ -p __password__
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 📋 Pre-Publishing Checklist
|
|
92
|
+
|
|
93
|
+
### ✅ Code Quality
|
|
94
|
+
- [ ] All functions documented with docstrings
|
|
95
|
+
- [ ] Type hints implemented
|
|
96
|
+
- [ ] Code formatted with black
|
|
97
|
+
- [ ] No linting errors (flake8)
|
|
98
|
+
- [ ] Tests passing (pytest)
|
|
99
|
+
|
|
100
|
+
### ✅ Package Structure
|
|
101
|
+
- [ ] pyproject.toml properly configured
|
|
102
|
+
- [ ] All required dependencies listed
|
|
103
|
+
- [ ] Version number updated
|
|
104
|
+
- [ ] License file included
|
|
105
|
+
- [ ] README files updated
|
|
106
|
+
|
|
107
|
+
### ✅ Functionality
|
|
108
|
+
- [ ] Hugging Face integration working
|
|
109
|
+
- [ ] CRS handling automatic
|
|
110
|
+
- [ ] Cache system functional
|
|
111
|
+
- [ ] All read_* functions working
|
|
112
|
+
- [ ] Spatial functions working
|
|
113
|
+
|
|
114
|
+
## 🧪 Testing After Publication
|
|
115
|
+
|
|
116
|
+
### Install from PyPI
|
|
117
|
+
```bash
|
|
118
|
+
# Create fresh environment
|
|
119
|
+
python -m venv test_env
|
|
120
|
+
source test_env/bin/activate
|
|
121
|
+
|
|
122
|
+
# Install from PyPI
|
|
123
|
+
pip install geomoz
|
|
124
|
+
|
|
125
|
+
# Test basic functionality
|
|
126
|
+
python -c "
|
|
127
|
+
import geomoz
|
|
128
|
+
provinces = geomoz.read_province()
|
|
129
|
+
print(f'Loaded {len(provinces)} provinces')
|
|
130
|
+
"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Install with Extras
|
|
134
|
+
```bash
|
|
135
|
+
# Test complete installation
|
|
136
|
+
pip install geomoz[complete]
|
|
137
|
+
|
|
138
|
+
# Test with visualization
|
|
139
|
+
python -c "
|
|
140
|
+
import geomoz
|
|
141
|
+
import matplotlib.pyplot as plt
|
|
142
|
+
provinces = geomoz.read_province()
|
|
143
|
+
provinces.plot()
|
|
144
|
+
plt.savefig('test.png')
|
|
145
|
+
print('Visualization test passed')
|
|
146
|
+
"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 🔄 Version Management
|
|
150
|
+
|
|
151
|
+
### Semantic Versioning
|
|
152
|
+
- **Major**: Breaking changes (2.0.0)
|
|
153
|
+
- **Minor**: New features (1.1.0)
|
|
154
|
+
- **Patch**: Bug fixes (1.0.1)
|
|
155
|
+
|
|
156
|
+
### Update Process
|
|
157
|
+
1. Update version in `pyproject.toml`
|
|
158
|
+
2. Update version in `setup.py`
|
|
159
|
+
3. Update CHANGELOG.md
|
|
160
|
+
4. Commit changes
|
|
161
|
+
5. Build and publish
|
|
162
|
+
|
|
163
|
+
## 📊 Distribution Channels
|
|
164
|
+
|
|
165
|
+
### Primary: PyPI
|
|
166
|
+
- **URL**: https://pypi.org/project/geomoz/
|
|
167
|
+
- **Install**: `pip install geomoz`
|
|
168
|
+
- **Audience**: General users, developers
|
|
169
|
+
|
|
170
|
+
### Secondary: GitHub
|
|
171
|
+
- **URL**: https://github.com/geolithicamz/geomoz
|
|
172
|
+
- **Source**: Development version
|
|
173
|
+
- **Issues**: Bug tracking and feature requests
|
|
174
|
+
|
|
175
|
+
### Data: Hugging Face
|
|
176
|
+
- **URL**: https://huggingface.co/geolithicamz/geomoz-data
|
|
177
|
+
- **Purpose**: Dataset distribution
|
|
178
|
+
- **Integration**: Automatic download and caching
|
|
179
|
+
|
|
180
|
+
## 🎯 Success Metrics
|
|
181
|
+
|
|
182
|
+
### Installation Success
|
|
183
|
+
```bash
|
|
184
|
+
# Track downloads
|
|
185
|
+
pip install geomoz
|
|
186
|
+
python -c "import geomoz; print('✅ Installation successful')"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Functionality Verification
|
|
190
|
+
```python
|
|
191
|
+
import geomoz
|
|
192
|
+
|
|
193
|
+
# Test core functionality
|
|
194
|
+
try:
|
|
195
|
+
provinces = geomoz.read_province()
|
|
196
|
+
geology = geomoz.read_geology()
|
|
197
|
+
geo_zambezia = geomoz.geology_by_province(name_province="Zambézia")
|
|
198
|
+
area = geomoz.calculate_area(geo_zambezia)
|
|
199
|
+
|
|
200
|
+
print("✅ All core functions working")
|
|
201
|
+
print(f"✅ Provinces: {len(provinces)}")
|
|
202
|
+
print(f"✅ Geology units: {len(geology)}")
|
|
203
|
+
print(f"✅ Zambézia geology: {len(geo_zambezia)}")
|
|
204
|
+
print(f"✅ Area calculation: {area['area_km2'].sum():.2f} km²")
|
|
205
|
+
|
|
206
|
+
except Exception as e:
|
|
207
|
+
print(f"❌ Error: {e}")
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## 🆘 Troubleshooting
|
|
211
|
+
|
|
212
|
+
### Common Issues
|
|
213
|
+
|
|
214
|
+
#### Build Errors
|
|
215
|
+
```bash
|
|
216
|
+
# Missing build tools
|
|
217
|
+
pip install --upgrade build wheel setuptools
|
|
218
|
+
|
|
219
|
+
# Python not found
|
|
220
|
+
python3 -m build # Use python3 explicitly
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
#### Upload Errors
|
|
224
|
+
```bash
|
|
225
|
+
# Authentication failed
|
|
226
|
+
twine check dist/* # Check package first
|
|
227
|
+
twine upload --repository testpypi dist/* # Try test PyPI first
|
|
228
|
+
|
|
229
|
+
# File exists error
|
|
230
|
+
rm -rf dist/*
|
|
231
|
+
python build # Rebuild
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### Import Errors
|
|
235
|
+
```bash
|
|
236
|
+
# Missing dependencies
|
|
237
|
+
pip install -r requirements.txt
|
|
238
|
+
|
|
239
|
+
# Path issues
|
|
240
|
+
python -c "import sys; print(sys.path)"
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## 📞 Support Resources
|
|
244
|
+
|
|
245
|
+
### Documentation
|
|
246
|
+
- **Main README**: README.md
|
|
247
|
+
- **PyPI README**: README_PYPI.md
|
|
248
|
+
- **API Docs**: Inline docstrings
|
|
249
|
+
|
|
250
|
+
### Community
|
|
251
|
+
- **Issues**: https://github.com/geolithicamz/geomoz/issues
|
|
252
|
+
- **Discussions**: https://github.com/geolithicamz/geomoz/discussions
|
|
253
|
+
- **Wiki**: https://github.com/geolithicamz/geomoz/wiki
|
|
254
|
+
|
|
255
|
+
### Contacts
|
|
256
|
+
- **Email**: contact@geolithica.org
|
|
257
|
+
- **Organization**: Geolithica
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## 🎉 Publication Success!
|
|
262
|
+
|
|
263
|
+
Once published successfully:
|
|
264
|
+
|
|
265
|
+
1. **Verify**: Check https://pypi.org/project/geomoz/
|
|
266
|
+
2. **Announce**: Share with community
|
|
267
|
+
3. **Monitor**: Track downloads and issues
|
|
268
|
+
4. **Maintain**: Update based on user feedback
|
|
269
|
+
|
|
270
|
+
**GeoMoz will be available globally via `pip install geomoz`!** 🇲🇿
|