Match or create providers for raw records

Abierto
#1,913 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Start by reading the extractor code that creates agencytxt and feedinfo records, the shared services under api/src/shared, and the tasks_executor task patterns. Trace how records, providers, aliases, and contacts are stored, then identify existing URL normalization and locking support. Done means new and backfilled records are linked idempotently, matching follows the stated name and normalized URL rules, and concurrent runs do not create duplicate providers.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Describe the problem

Every raw agency.txt and feed_info.txt record needs a provider, and there is no capacity to review each one by hand.

Proposed solution
  • Shared link service in api/src/shared: links a record to a provider and adds the record's name as an alias and its URL, email and phone as contacts when missing (URLs compared after normalization). Nothing is removed or overwritten.
  • When the extractor creates a new agencytxt or feedinfo record:
    • if a linked record of the same type has the same name (trimmed) and the same normalized URL, link to its provider;
    • otherwise create a provider (name from the record, status published) and link it.
  • A record without a URL never matches and gets its own provider.
  • Serialize match-or-create per name and normalized URL (advisory lock) so concurrent tasks don't create duplicate providers.
  • tasks_executor task to run match-or-create on all unlinked records (backfill after #1909).

Acceptance criteria:

  • Every new record is linked to a provider.
  • http/https, www. and trailing / differences still match; name differences do not.
  • Reruns and concurrent runs create no duplicate providers.
  • No fuzzy matching or confidence score.
Alternatives you've considered
  • Leaving unmatched records unlinked for manual review: rejected, not enough people to process the queue.
  • Matching on name or URL alone: rejected, a shared parent website or a generic name would wrongly merge separate agencies.
Additional context
Lenguaje dominante
Python
Estrellas
34
Forks
7
Merge medio
2 d 22 h
PR fusionados (30 d)
21

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de MobilityData/mobility-feed-api

Todos los issues de MobilityData/mobility-feed-api

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.