Verificar los datos de localiz.ar con Python
Project description
LOCALIZ.AR (BACK-END CON PYTHON)
Verificación de direcciones argentinas generadas con la librería
Front-End de localiz.ar
Este paquete permite validar en el Back-End los objetos de dirección
creados automáticamente por el formulario de localiz.ar, asegurando que
los IDs enviados por el cliente existan realmente en la base de datos.
Instalación
pip install localiz-ar
Uso básico
from localiz_ar import verify
result = verify({
"prov_id": 153536,
"city_id": 11909161,
"street_id": 0,
"number": 123,
"floor": "Departamento 21"
})
if result[0]:
print("Dirección válida")
else:
print("Error en el campo:", result[1])
Método verify()
El método verify() es una función síncrona y cuenta con los siguientes parámetros:
verify(data, check_level)
- data (
dict): datos extraídos de la librería Front-End - check_level (
int): nivel de verificación de datos
El retorno será una tupla:
[status, property]
status(bool): False si alguna propiedad es incorrectaproperty(str): nombre de la propiedad incorrecta
IMPORTANTE: si hay un error de conexión con la base de datos, el método devolverá:
[False, "internal"]
Formato del objeto data
{
"prov_id": int,
"city_id": int,
"street_id": int,
"number": int,
"floor": str
}
Estos valores son generados automáticamente por el método validate() de la librería Front-End de localiz.ar.
Niveles de verificación
| Nivel | Verificación |
|---|---|
| 1 | Provincia |
| 2 | Provincia y ciudad |
| 3 | Provincia, ciudad y calle |
| 4 | Provincia, ciudad, calle y número de calle |
| 5 | Provincia, ciudad, calle, número de calle y piso |
License
https://opendatacommons.org/licenses/odbl/1.0/
https://opendatacommons.org/licenses/dbcl/1.0/
Data sources
© OpenStreetMap contributors
https://www.openstreetmap.org/copyright
Servicio GeoRef – Instituto Geográfico Nacional (Argentina)
https://creativecommons.org/licenses/by/4.0/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file localiz_ar-1.0.0.tar.gz.
File metadata
- Download URL: localiz_ar-1.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29bb367dc7d8d5b6888a69e91f8f5b9f94da0a355c39c71da0100b6cf2ab06f9
|
|
| MD5 |
129cd908708e5ea3d02e3757729386b1
|
|
| BLAKE2b-256 |
514f10b53fd8cdf28f1a0f13a2c5eb895d0e82e252b737f86727cd7b001e6b35
|
File details
Details for the file localiz_ar-1.0.0-py3-none-any.whl.
File metadata
- Download URL: localiz_ar-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e177021ecbdbbe4318b56b8f2eb418d2cf8b0c96ba367cbe241bd45a8a4e846
|
|
| MD5 |
aaa8422abd455b40adef004d24ef0f20
|
|
| BLAKE2b-256 |
a3bbd9c536ef88a47f9211f521e6eb5a22a16de8c7b170bb1a19c96ef139159a
|