ESCatastroLib 0.0.1rc4__tar.gz → 1.0.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.
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/.gitignore +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/CODE_OF_CONDUCT.md +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/CONTRIBUTING.md +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/LICENSE +0 -0
- escatastrolib-0.0.1rc4/README.md → escatastrolib-1.0.0/PKG-INFO +58 -0
- escatastrolib-0.0.1rc4/PKG-INFO → escatastrolib-1.0.0/README.md +28 -28
- escatastrolib-1.0.0/TODO_Python314_Compatibility.md +40 -0
- escatastrolib-1.0.0/TODO_Refactorizacion.md +34 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/pyproject.toml +28 -11
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/__about__.py +1 -1
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/__init__.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/models/Calle.py +0 -0
- escatastrolib-1.0.0/src/escatastrolib/models/InfoCatastral.py +753 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/models/Municipio.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/models/__init__.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/utils/__init__.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/utils/converters.py +2 -1
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/utils/exceptions.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/utils/statics.py +32 -1
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/src/escatastrolib/utils/utils.py +13 -1
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/tests/__init__.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/tests/test_calle.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/tests/test_import.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/tests/test_info_catastral.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/tests/test_municipio.py +0 -0
- {escatastrolib-0.0.1rc4 → escatastrolib-1.0.0}/tests/test_utils.py +0 -0
- escatastrolib-0.0.1rc4/src/escatastrolib/models/InfoCatastral.py +0 -427
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ESCatastroLib
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Una librería de Python para consultar los datos del Catastro COMO OBJETOS. Incluye información geográfica.
|
|
5
|
+
Project-URL: Documentation, https://github.com/IvanitiX/ESCatastroLib#readme
|
|
6
|
+
Project-URL: Issues, https://github.com/IvanitiX/ESCatastroLib/issues
|
|
7
|
+
Project-URL: Source, https://github.com/IvanitiX/ESCatastroLib
|
|
8
|
+
Author-email: "Iván V.R" <IvanVR@protonmail.com>
|
|
9
|
+
License: Apache License (2.0)
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: catastro,espana,gis,spain
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Natural Language :: Spanish
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
19
|
+
Requires-Dist: folium
|
|
20
|
+
Requires-Dist: geopandas<0.14; python_version < '3.9'
|
|
21
|
+
Requires-Dist: geopandas>=0.14; python_version >= '3.9'
|
|
22
|
+
Requires-Dist: geopy
|
|
23
|
+
Requires-Dist: pyarrow<14; python_version < '3.9'
|
|
24
|
+
Requires-Dist: pyarrow>=14; python_version >= '3.9'
|
|
25
|
+
Requires-Dist: requests
|
|
26
|
+
Requires-Dist: shapely<2; python_version < '3.9'
|
|
27
|
+
Requires-Dist: shapely>=2; python_version >= '3.9'
|
|
28
|
+
Requires-Dist: xmltodict
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
1
31
|
# ESCatastroLib
|
|
2
32
|
|
|
3
33
|
La librería ESCatastroLib proporciona una interfaz sencilla para consultar el Catastro de España y obtener información geográfica precisa. Con esta librería, puedes acceder a datos como la ubicación de parcelas, características de construcción y valores geográficos.
|
|
@@ -88,6 +118,34 @@ referencia a una MetaParcela.
|
|
|
88
118
|
* `regiones (list)`: Una lista de regiones en la parcela con una descripción y superficie.
|
|
89
119
|
* `centroide (dict)`: Las coordenadas del centroide de la parcela. (Latitud y longitud)
|
|
90
120
|
* `geometria (list)`: Una lista de puntos que representan la geometría de la parcela. (Latitud y longitud)
|
|
121
|
+
* `superficie_total (float)`: La superficie total de la parcela en metros cuadrados.
|
|
122
|
+
* `superficie_construida (float)`: La superficie construida en metros cuadrados.
|
|
123
|
+
* `superficie (float)`: La superficie total de las regiones en metros cuadrados.
|
|
124
|
+
|
|
125
|
+
**Métodos:**
|
|
126
|
+
|
|
127
|
+
* `distancias_aristas` (property): Calcula las distancias entre puntos consecutivos de la geometría de la parcela.
|
|
128
|
+
* Returns: `Optional[List[float]]` - Lista de distancias entre aristas consecutivas en metros, o None si no hay geometría.
|
|
129
|
+
|
|
130
|
+
* `perimetro` (property): Calcula el perímetro total de la geometría de la parcela.
|
|
131
|
+
* Returns: `Optional[float]` - Perímetro total en metros, o None si no hay geometría.
|
|
132
|
+
|
|
133
|
+
* `valor_catastral_urbano_m2(anio: int) -> Optional[float]`: Obtiene el valor catastral por metro cuadrado para parcelas urbanas.
|
|
134
|
+
* Args: `anio` (int) - Año del valor catastral a consultar.
|
|
135
|
+
* Returns: Valor catastral en €/m², 0 si es rústica, o None si hay algún error.
|
|
136
|
+
|
|
137
|
+
* `valor_catastral_rustico_m2(anio: str) -> Optional[Dict]`: Obtiene los valores catastrales de tierras para parcelas rústicas.
|
|
138
|
+
* Args: `anio` (str) - Año del valor catastral a consultar.
|
|
139
|
+
* Returns: Diccionario con `region`, `nombre_region` y `modulos_€/ha`, o None si no se encuentran.
|
|
140
|
+
|
|
141
|
+
* `numero_plantas` (property): Obtiene el número de plantas de un edificio.
|
|
142
|
+
* Returns: `Dict[str, Any]` con claves `plantas`, `sotanos` y `total`.
|
|
143
|
+
|
|
144
|
+
* `to_dataframe()`: Convierte la parcela en un GeoDataFrame de GeoPandas.
|
|
145
|
+
* `to_json(filename: Optional[str] = None) -> str`: Convierte la parcela a JSON.
|
|
146
|
+
* `to_csv(filename: Optional[str] = None) -> str`: Convierte la parcela a CSV.
|
|
147
|
+
* `to_shapefile(filename: str)`: Guarda la parcela como Shapefile.
|
|
148
|
+
* `to_parquet(filename: str)`: Guarda la parcela como Parquet.
|
|
91
149
|
|
|
92
150
|
|
|
93
151
|
## Clase MetaParcela
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: ESCatastroLib
|
|
3
|
-
Version: 0.0.1rc4
|
|
4
|
-
Summary: Una librería de Python para consultar los datos del Catastro COMO OBJETOS. Incluye información geográfica.
|
|
5
|
-
Project-URL: Documentation, https://github.com/IvanitiX/ESCatastroLib#readme
|
|
6
|
-
Project-URL: Issues, https://github.com/IvanitiX/ESCatastroLib/issues
|
|
7
|
-
Project-URL: Source, https://github.com/IvanitiX/ESCatastroLib
|
|
8
|
-
Author-email: "Iván V.R" <IvanVR@protonmail.com>
|
|
9
|
-
License: Apache License (2.0)
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Keywords: catastro,espana,gis,spain
|
|
12
|
-
Classifier: Development Status :: 3 - Alpha
|
|
13
|
-
Classifier: Framework :: Pytest
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
-
Classifier: Natural Language :: Spanish
|
|
17
|
-
Classifier: Operating System :: OS Independent
|
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Topic :: Software Development :: Build Tools
|
|
20
|
-
Requires-Dist: folium
|
|
21
|
-
Requires-Dist: geopandas
|
|
22
|
-
Requires-Dist: pyarrow
|
|
23
|
-
Requires-Dist: pytest
|
|
24
|
-
Requires-Dist: requests
|
|
25
|
-
Requires-Dist: shapely
|
|
26
|
-
Requires-Dist: xmltodict
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
|
|
29
1
|
# ESCatastroLib
|
|
30
2
|
|
|
31
3
|
La librería ESCatastroLib proporciona una interfaz sencilla para consultar el Catastro de España y obtener información geográfica precisa. Con esta librería, puedes acceder a datos como la ubicación de parcelas, características de construcción y valores geográficos.
|
|
@@ -116,6 +88,34 @@ referencia a una MetaParcela.
|
|
|
116
88
|
* `regiones (list)`: Una lista de regiones en la parcela con una descripción y superficie.
|
|
117
89
|
* `centroide (dict)`: Las coordenadas del centroide de la parcela. (Latitud y longitud)
|
|
118
90
|
* `geometria (list)`: Una lista de puntos que representan la geometría de la parcela. (Latitud y longitud)
|
|
91
|
+
* `superficie_total (float)`: La superficie total de la parcela en metros cuadrados.
|
|
92
|
+
* `superficie_construida (float)`: La superficie construida en metros cuadrados.
|
|
93
|
+
* `superficie (float)`: La superficie total de las regiones en metros cuadrados.
|
|
94
|
+
|
|
95
|
+
**Métodos:**
|
|
96
|
+
|
|
97
|
+
* `distancias_aristas` (property): Calcula las distancias entre puntos consecutivos de la geometría de la parcela.
|
|
98
|
+
* Returns: `Optional[List[float]]` - Lista de distancias entre aristas consecutivas en metros, o None si no hay geometría.
|
|
99
|
+
|
|
100
|
+
* `perimetro` (property): Calcula el perímetro total de la geometría de la parcela.
|
|
101
|
+
* Returns: `Optional[float]` - Perímetro total en metros, o None si no hay geometría.
|
|
102
|
+
|
|
103
|
+
* `valor_catastral_urbano_m2(anio: int) -> Optional[float]`: Obtiene el valor catastral por metro cuadrado para parcelas urbanas.
|
|
104
|
+
* Args: `anio` (int) - Año del valor catastral a consultar.
|
|
105
|
+
* Returns: Valor catastral en €/m², 0 si es rústica, o None si hay algún error.
|
|
106
|
+
|
|
107
|
+
* `valor_catastral_rustico_m2(anio: str) -> Optional[Dict]`: Obtiene los valores catastrales de tierras para parcelas rústicas.
|
|
108
|
+
* Args: `anio` (str) - Año del valor catastral a consultar.
|
|
109
|
+
* Returns: Diccionario con `region`, `nombre_region` y `modulos_€/ha`, o None si no se encuentran.
|
|
110
|
+
|
|
111
|
+
* `numero_plantas` (property): Obtiene el número de plantas de un edificio.
|
|
112
|
+
* Returns: `Dict[str, Any]` con claves `plantas`, `sotanos` y `total`.
|
|
113
|
+
|
|
114
|
+
* `to_dataframe()`: Convierte la parcela en un GeoDataFrame de GeoPandas.
|
|
115
|
+
* `to_json(filename: Optional[str] = None) -> str`: Convierte la parcela a JSON.
|
|
116
|
+
* `to_csv(filename: Optional[str] = None) -> str`: Convierte la parcela a CSV.
|
|
117
|
+
* `to_shapefile(filename: str)`: Guarda la parcela como Shapefile.
|
|
118
|
+
* `to_parquet(filename: str)`: Guarda la parcela como Parquet.
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
## Clase MetaParcela
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# TODO: Python 3.8-3.14 Compatibility Update
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
Update the ESCatastroLib library to be compatible with Python versions 3.8 through 3.14.
|
|
5
|
+
|
|
6
|
+
## Tasks
|
|
7
|
+
|
|
8
|
+
### 1. Update pyproject.toml
|
|
9
|
+
- [x] Add "3.14" to the test matrix under `[tool.hatch.envs.test.matrix]`
|
|
10
|
+
- [ ] Ensure all dependencies support Python 3.8-3.14 range
|
|
11
|
+
|
|
12
|
+
### 2. Code Review and Updates
|
|
13
|
+
- [x] Review `src/escatastrolib/models/InfoCatastral.py` for deprecated patterns
|
|
14
|
+
- [x] Review `src/escatastrolib/utils/utils.py` for deprecated patterns
|
|
15
|
+
- [x] Check for any `list(dict.values())[0]` patterns that may need updating
|
|
16
|
+
- [x] Verify `typing` imports are compatible with all Python versions
|
|
17
|
+
|
|
18
|
+
### 3. Testing
|
|
19
|
+
- [x] Verify the library can be imported successfully
|
|
20
|
+
- [x] Run existing tests to ensure compatibility
|
|
21
|
+
- [x] Check for any deprecation warnings
|
|
22
|
+
|
|
23
|
+
### 4. Documentation
|
|
24
|
+
- [ ] Update README.md if needed
|
|
25
|
+
- [ ] Verify classifiers in pyproject.toml are accurate
|
|
26
|
+
|
|
27
|
+
## Notes
|
|
28
|
+
- Must maintain backward compatibility with Python 3.8
|
|
29
|
+
- Python 3.14 may have stricter type checking and deprecation warnings
|
|
30
|
+
- Some patterns may work but trigger deprecation warnings
|
|
31
|
+
|
|
32
|
+
## Progress
|
|
33
|
+
- [x] Analyzed codebase structure
|
|
34
|
+
- [x] Reviewed pyproject.toml configuration
|
|
35
|
+
- [x] Reviewed main source files for potential compatibility issues
|
|
36
|
+
- [x] Implemented updates for Python 3.14 compatibility
|
|
37
|
+
- [x] Updated pyproject.toml to include Python 3.14 in test matrix
|
|
38
|
+
- [x] Verified library imports successfully
|
|
39
|
+
- [x] Ran tests to verify compatibility
|
|
40
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# TODO: Refactorización de InfoCatastral.py
|
|
2
|
+
|
|
3
|
+
## Objetivo
|
|
4
|
+
Refactorizar el archivo `src/escatastrolib/models/InfoCatastral.py` para mejorar:
|
|
5
|
+
- Eliminación de código duplicado entre `ParcelaCatastral` y `MetaParcela`
|
|
6
|
+
- Mejor manejo de errores
|
|
7
|
+
- Type hints en todos los métodos
|
|
8
|
+
- Docstrings mejorados
|
|
9
|
+
|
|
10
|
+
## Cambios de Nomenclatura
|
|
11
|
+
- `BaseParcela` → `ParcelaHelper`
|
|
12
|
+
- `_make_api_request` → `_llamar_a_api`
|
|
13
|
+
|
|
14
|
+
## Estado Actual (Actualizado: 2024)
|
|
15
|
+
- ✅ Fase 1: Extracción de funcionalidades comunes - COMPLETADA
|
|
16
|
+
- ✅ Fase 2: Refactorización de ParcelaCatastral - COMPLETADA
|
|
17
|
+
- ✅ Fase 3: Refactorización de MetaParcela - COMPLETADA
|
|
18
|
+
- ✅ Fase 4: Validación - COMPLETADA (10 tests pasan)
|
|
19
|
+
- ✅ Fase 5: Type Hints y Docstrings Faltantes - COMPLETADA
|
|
20
|
+
- ✅ `__create_regions()` - type hints y docstring agregados
|
|
21
|
+
- ✅ `__create_geometry()` - type hints y docstring agregados, usa `_llamar_a_api()`
|
|
22
|
+
- ✅ `distancias_aristas` - type hints agregados (`Optional[List[float]]`)
|
|
23
|
+
- ✅ `perimetro` - type hints agregados (`Optional[float]`)
|
|
24
|
+
- ✅ `valor_catastral_urbano_m2()` - type hints agregados, usa `_llamar_a_api()`
|
|
25
|
+
- ✅ `numero_plantas` - type hints y docstring mejorados
|
|
26
|
+
- ✅ `valor_catastral_rustico_m2()` - type hints en parámetro
|
|
27
|
+
|
|
28
|
+
## Tests
|
|
29
|
+
- ✅ Todos los 10 tests pasan sin regresiones
|
|
30
|
+
|
|
31
|
+
## Notas
|
|
32
|
+
- Mantener compatibilidad con la API existente
|
|
33
|
+
- No cambiar la firma pública de los métodos
|
|
34
|
+
|
|
@@ -19,17 +19,27 @@ classifiers = [
|
|
|
19
19
|
"Topic :: Software Development :: Build Tools",
|
|
20
20
|
"License :: OSI Approved :: Apache Software License",
|
|
21
21
|
"Operating System :: OS Independent",
|
|
22
|
-
"Natural Language :: Spanish"
|
|
23
|
-
"Framework :: Pytest",
|
|
22
|
+
"Natural Language :: Spanish"
|
|
24
23
|
]
|
|
24
|
+
|
|
25
25
|
dependencies = [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
# comunes (siempre)
|
|
27
|
+
"requests",
|
|
28
|
+
"xmltodict",
|
|
29
|
+
"folium",
|
|
30
|
+
"geopy",
|
|
31
|
+
|
|
32
|
+
# --- shapely ---
|
|
33
|
+
"shapely<2; python_version<'3.9'",
|
|
34
|
+
"shapely>=2; python_version>='3.9'",
|
|
35
|
+
|
|
36
|
+
# --- geopandas ---
|
|
37
|
+
"geopandas<0.14; python_version<'3.9'",
|
|
38
|
+
"geopandas>=0.14; python_version>='3.9'",
|
|
39
|
+
|
|
40
|
+
# --- pyarrow ---
|
|
41
|
+
"pyarrow<14; python_version<'3.9'",
|
|
42
|
+
"pyarrow>=14; python_version>='3.9'",
|
|
33
43
|
]
|
|
34
44
|
|
|
35
45
|
|
|
@@ -45,11 +55,17 @@ path = "src/escatastrolib/__about__.py"
|
|
|
45
55
|
extra-dependencies = [
|
|
46
56
|
"mypy>=1.0.0",
|
|
47
57
|
]
|
|
58
|
+
|
|
48
59
|
[tool.hatch.envs.types.scripts]
|
|
49
60
|
check = "mypy --install-types --non-interactive {args:src/escatastrolib tests}"
|
|
50
61
|
|
|
51
|
-
[
|
|
52
|
-
|
|
62
|
+
[tool.hatch.envs.hatch-test]
|
|
63
|
+
dependencies = [
|
|
64
|
+
"pytest",
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
[[tool.hatch.envs.hatch-test.matrix]]
|
|
68
|
+
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
53
69
|
|
|
54
70
|
[tool.coverage.run]
|
|
55
71
|
source_pkgs = ["escatastrolib", "tests"]
|
|
@@ -69,3 +85,4 @@ exclude_lines = [
|
|
|
69
85
|
"if __name__ == .__main__.:",
|
|
70
86
|
"if TYPE_CHECKING:",
|
|
71
87
|
]
|
|
88
|
+
|
|
File without changes
|
|
File without changes
|