mirror of
https://github.com/zvx-echo6/recon.git
synced 2026-06-10 00:44:37 +02:00
After cleanup #4 deleted lib/geocode.py, the only remaining address_book references in recon were lib/address_book_test.py (test of the dying SUT) and a dead `from . import address_book` import at the top of lib/netsyms_api.py (never referenced in the body). This PR removes all three. - DELETE lib/address_book.py + lib/address_book_test.py - netsyms_api.py: drop the dead `from . import address_book` import config/address_book.yaml stays — vendored data, navi-contacts (:8423) consumes its own copy via NAVI_ADDRESS_BOOK_YAML. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
31 lines
818 B
Python
31 lines
818 B
Python
"""
|
|
RECON Netsyms API — Flask Blueprint.
|
|
|
|
GET /api/netsyms/lookup?q=<free text>&country=<optional>
|
|
GET /api/netsyms/health
|
|
"""
|
|
|
|
from flask import Blueprint, request, jsonify
|
|
|
|
from . import netsyms
|
|
from .utils import setup_logging
|
|
|
|
logger = setup_logging('recon.netsyms_api')
|
|
|
|
netsyms_bp = Blueprint('netsyms', __name__)
|
|
|
|
|
|
@netsyms_bp.route('/api/netsyms/lookup')
|
|
def api_netsyms_lookup():
|
|
q = request.args.get('q', '').strip()
|
|
if not q:
|
|
return jsonify({'error': 'Missing q parameter'}), 400
|
|
|
|
country = request.args.get('country', '').strip() or None
|
|
results = netsyms.lookup_free_text(q, country_hint=country)
|
|
return jsonify({'results': results, 'count': len(results), 'query': q})
|
|
|
|
|
|
@netsyms_bp.route('/api/netsyms/health')
|
|
def api_netsyms_health():
|
|
return jsonify(netsyms.health())
|