Annuaire des Entreprises lookup: names and addresses arrive in capitals with abbreviated street types #1244

Open
opened 2026-11-13 10:22:58 +00:00 by tiagoagueda · 0 comments
Owner

What happens

The lookup in the Annuaire des Entreprises (the fr-recherche-entreprises adapter of the register lookup plugin) copies what the API answers: the name, the street and the municipality come back in capitals, and the street type is the register's abbreviation. A company found this way is saved as 15 AV DES CHAMPS ELYSEES, 75008 PARIS, DUPONT SERVICES, which looks wrong beside every other record.

Where

src/postulo/plugins/register_lookup/adapters.py, _france(): name (nom_raison_sociale / nom_complet), street (numero_voie, type_voie, libelle_voie) and municipality (libelle_commune) are used as received.

Expected

  • Case: the name, the street and the municipality are written the way a person would write them: Avenue des Champs-Élysées, Saint-Denis. Small words (de, du, des, la, le, et, sur, sous) stay lower case; l' and d' are kept; a hyphen starts a new capital (Saint-Denis); roman numerals and acronyms stay upper case.
  • Abbreviations: the street type is spelled out from the register's own code list (the type_voie codes: AV Avenue, BD Boulevard, CHE Chemin, RTE Route, ALL Allée, IMP Impasse, PL Place, QUAI, RUE, CRS Cours, SQ Square, PAS Passage, ZA, ZI, and the rest of the list), and ST / STE inside a name become Saint / Sainte.
  • Accents: the register publishes capitals without accents; restore them only where the form is certain (for example from the INSEE commune list), and otherwise leave the letters as they are rather than guess.
  • Names that are acronyms (AXA, EDF, SNCF) must not become Axa, Edf, Sncf. A short word of capitals with no vowel, or one the company already holds in capitals elsewhere, stays as it is; say in the issue's decision what rule is used.
  • Applies only to the text a lookup brings in. The person's own edits are never rewritten, and a record already saved is changed only if the person looks it up again and accepts the new value.

Tests

A table of cases for the formatter (street types, particles, apostrophes, hyphens, acronyms, roman numerals, accents) and one adapter test with a recorded API answer for a company whose name and address are in capitals.

Other registers

Check the other adapters in the same file (Norway, Finland, Czechia, Poland, GLEIF) for the same problem and apply the formatter where a register answers in capitals.

## What happens The lookup in the Annuaire des Entreprises (the `fr-recherche-entreprises` adapter of the register lookup plugin) copies what the API answers: the name, the street and the municipality come back in capitals, and the street type is the register's abbreviation. A company found this way is saved as `15 AV DES CHAMPS ELYSEES`, `75008 PARIS`, `DUPONT SERVICES`, which looks wrong beside every other record. ## Where `src/postulo/plugins/register_lookup/adapters.py`, `_france()`: `name` (`nom_raison_sociale` / `nom_complet`), `street` (`numero_voie`, `type_voie`, `libelle_voie`) and `municipality` (`libelle_commune`) are used as received. ## Expected - **Case:** the name, the street and the municipality are written the way a person would write them: `Avenue des Champs-Élysées`, `Saint-Denis`. Small words (`de`, `du`, `des`, `la`, `le`, `et`, `sur`, `sous`) stay lower case; `l'` and `d'` are kept; a hyphen starts a new capital (`Saint-Denis`); roman numerals and acronyms stay upper case. - **Abbreviations:** the street type is spelled out from the register's own code list (the `type_voie` codes: `AV` Avenue, `BD` Boulevard, `CHE` Chemin, `RTE` Route, `ALL` Allée, `IMP` Impasse, `PL` Place, `QUAI`, `RUE`, `CRS` Cours, `SQ` Square, `PAS` Passage, `ZA`, `ZI`, and the rest of the list), and `ST` / `STE` inside a name become `Saint` / `Sainte`. - **Accents:** the register publishes capitals without accents; restore them only where the form is certain (for example from the INSEE commune list), and otherwise leave the letters as they are rather than guess. - **Names that are acronyms** (`AXA`, `EDF`, `SNCF`) must not become `Axa`, `Edf`, `Sncf`. A short word of capitals with no vowel, or one the company already holds in capitals elsewhere, stays as it is; say in the issue's decision what rule is used. - Applies only to the text a lookup brings in. The person's own edits are never rewritten, and a record already saved is changed only if the person looks it up again and accepts the new value. ## Tests A table of cases for the formatter (street types, particles, apostrophes, hyphens, acronyms, roman numerals, accents) and one adapter test with a recorded API answer for a company whose name and address are in capitals. ## Other registers Check the other adapters in the same file (Norway, Finland, Czechia, Poland, GLEIF) for the same problem and apply the formatter where a register answers in capitals.
tiagoagueda added this to the 0.6.0 milestone 2026-11-13 10:22:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#1244
No description provided.