Spaces:
Sleeping
Sleeping
Download models/construction_identity.py from gui-sparim/teste_docs: direct link, hf CLI and curl.
- Browser
- Download file 763 Bytes
-
https://huggingface.co/spaces/gui-sparim/teste_docs/resolve/main/models/construction_identity.py
- Command line
-
hf download hf://spaces/gui-sparim/teste_docs/models/construction_identity.py
-
curl -L -o construction_identity.py https://huggingface.co/spaces/gui-sparim/teste_docs/resolve/main/models/construction_identity.py
763 Bytes
| """Annual MQC copies get new UUIDs; group by property and sequence instead.""" | |
| import json | |
| import re | |
| def construction_identity(source, construction, index): | |
| name = str((source.get('construcao') or {}).get('fonteNome') or '') | |
| registration = re.search(r'inscri[çc][aã]o\s*[:\-]?\s*([\d.\-/]+)',name,re.I) | |
| unit = source.get('imovelId') or source.get('unidadeId') or source.get('identificacaoImovel') | |
| unit = unit or (registration[1] if registration else '') | |
| location = (source.get('terreno') or {}).get('localizacao') or {} | |
| return json.dumps([unit,location.get('lat'),location.get('lon'),construction.get('seq') or index+1, | |
| construction.get('nome') or '',construction.get('anoConstrucao') or ''],ensure_ascii=False) | |