Geocodificador asíncrono para Cataluña usando el servicio ICGC
Project description
GeoFinder-ICGC
Geocoder for Catalonia using the ICGC service (Institut Cartogràfic i Geològic de Catalunya). 🔄 Dual API: Native async + sync wrappers for simple scripts.
GeoFinder-ICGC is an advanced geocoder for Catalonia designed to be robust, fast, and easy to use.
🚀 Installation
# Basic installation
pip install geofinder-icgc
# With coordinate transformation support (recommended)
pip install geofinder-icgc[pyproj]
# With MCP server support (AI integration)
pip install geofinder-icgc[mcp]
📖 Quick Start
Synchronous Usage (Simple scripts)
from geofinder import GeoFinder
gf = GeoFinder()
results = gf.find_sync("Barcelona")
for r in results:
print(f"{r.nom} ({r.nomTipus}) - {r.x}, {r.y}")
Asynchronous Usage (High performance)
import asyncio
from geofinder import GeoFinder
async def main():
async with GeoFinder() as gf:
results = await gf.find("Diagonal 100, Barcelona")
print(f"Found: {len(results)}")
asyncio.run(main())
🔍 Features Guide
1. General Search (find / find_sync)
Automatically detects the search type based on input:
- Toponyms:
"Montserrat","Girona" - Addresses:
"Carrer Aragó 50, Barcelona","Gran Via 123" - Coordinates:
"430000 4580000 EPSG:25831","2.17 41.38 EPSG:4326" - Roads:
"C-32 km 10" - Rectangles:
"X1 Y1 X2 Y2"
2. Reverse Geocoding (find_reverse / find_reverse_sync)
Find places or addresses from coordinates.
# Supports EPSG:25831 (default) and EPSG:4326 (GPS)
results = await gf.find_reverse(430000, 4580000)
3. Autocomplete (autocomplete / autocomplete_sync)
Ideal for implementing real-time search suggestions.
suggestions = await gf.autocomplete("Barcel")
4. Proximity Search (search_nearby)
Find places within a given radius around a reference point.
# Search everything within 2km of Sagrada Família
nearby = await gf.search_nearby("Sagrada Família, Barcelona", radius_km=2.0)
5. Batch Processing (find_batch / find_reverse_batch)
Execute multiple queries in parallel with optimized concurrency.
queries = ["Barcelona", "Girona", "Lleida", "Tarragona"]
batch_results = await gf.find_batch(queries, max_concurrency=10)
6. Response with Metadata (find_response)
Returns a GeoResponse object that includes results and performance metadata such as execution time.
⚙️ Configuration
The GeoFinder constructor allows customizing the library behavior:
| Parameter | Type | Description |
|---|---|---|
timeout |
int |
Maximum wait time (default: 5s). |
cache_size |
int |
LRU cache capacity (default: 128). |
cache_ttl |
int |
Cache time-to-live in seconds (default: 3600). |
max_retries |
int |
Number of retries on failure (default: 3). |
verify_ssl |
bool |
Verify SSL certificates (default: True). |
📚 Documentation
- COOKBOOK.md - Tutorials and practical examples
- README-DEV.md - Development guide
- README-MCP.md - MCP Server
- README-ARQ.md - Technical architecture
📚 Resources
⚖️ License
Distributed under the GPL-2.0-or-later license. Based on the original ICGC work adapted for standalone use.
© 2025 ICGC / Adapted by Goalnefesh
Small changes are powerful 🤘
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
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 geofinder_icgc-2.4.2.tar.gz.
File metadata
- Download URL: geofinder_icgc-2.4.2.tar.gz
- Upload date:
- Size: 43.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
113770fa575953d50b15f6bfcd566cc0024e2e5885ea4621ebcc3cc39bbad173
|
|
| MD5 |
215fa4ed03f88368104da2fa2c56fbaa
|
|
| BLAKE2b-256 |
978896f2f3ed6254ab6661571369297a73c4634fdf6fe842b55f21176e2c19e4
|
Provenance
The following attestation bundles were made for geofinder_icgc-2.4.2.tar.gz:
Publisher:
publish.yml on jccamel/geofinder-icgc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geofinder_icgc-2.4.2.tar.gz -
Subject digest:
113770fa575953d50b15f6bfcd566cc0024e2e5885ea4621ebcc3cc39bbad173 - Sigstore transparency entry: 959567924
- Sigstore integration time:
-
Permalink:
jccamel/geofinder-icgc@2cf1800bc82e1c9943bbdbed16064aba48c2f9c1 -
Branch / Tag:
refs/tags/v2.4.2 - Owner: https://github.com/jccamel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cf1800bc82e1c9943bbdbed16064aba48c2f9c1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file geofinder_icgc-2.4.2-py3-none-any.whl.
File metadata
- Download URL: geofinder_icgc-2.4.2-py3-none-any.whl
- Upload date:
- Size: 44.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a258b8d6fce04ebee22ec3e22b934a2d846562d07b24894dd897ee98c9718ab
|
|
| MD5 |
3ce91a68a0dde6a9d024e9948ca1a50b
|
|
| BLAKE2b-256 |
d9bc51af6a618205737087f6984017d2b528c38494c06ff4ad14b1cb4e3b843c
|
Provenance
The following attestation bundles were made for geofinder_icgc-2.4.2-py3-none-any.whl:
Publisher:
publish.yml on jccamel/geofinder-icgc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geofinder_icgc-2.4.2-py3-none-any.whl -
Subject digest:
5a258b8d6fce04ebee22ec3e22b934a2d846562d07b24894dd897ee98c9718ab - Sigstore transparency entry: 959567984
- Sigstore integration time:
-
Permalink:
jccamel/geofinder-icgc@2cf1800bc82e1c9943bbdbed16064aba48c2f9c1 -
Branch / Tag:
refs/tags/v2.4.2 - Owner: https://github.com/jccamel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cf1800bc82e1c9943bbdbed16064aba48c2f9c1 -
Trigger Event:
push
-
Statement type: