Skip to content

Commit

Permalink
analyser_merge_museum_FR: update from datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Jan 5, 2025
1 parent 0c2e956 commit 6c4618a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions analysers/analyser_merge_museum_FR.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def __init__(self, config, logger = None):
dataset="5d12ee8206e3e762c0c89a4c",
resource="5ccd6238-4fb0-4b2c-b14a-581909489320"),
separator=';'),
Load_XY("coordonnees", "coordonnees",
where = lambda row: row["coordonnees"],
Load_XY("Coordonnees", "Coordonnees",
where = lambda row: row["Coordonnees"],
xFunction = lambda x: x and x.split(',')[1],
yFunction = lambda y: y and y.split(',')[0]),
Conflate(
Expand All @@ -57,9 +57,9 @@ def __init__(self, config, logger = None):
mapping = Mapping(
static1 = {"tourism": "museum"},
static2 = {"source": self.source},
mapping1 = {"ref:FR:museofile": "identifiant"},
mapping1 = {"ref:FR:museofile": "Identifiant"},
mapping2 = {
"website": lambda res: None if not res["url"] else res["url"] if res["url"].startswith('http') else 'http://' + res["url"],
"phone": lambda res: "+33 " + res["telephone"][1:] if res["telephone"] and re_phone.match(res["telephone"]) else None,
"name": lambda res: res["nom_officiel"][0].upper() + res["nom_officiel"][1:] if res["nom_officiel"] else res["nom_officiel"][0].upper() + res["nom_officiel"][1:] if res["nom_officiel"] else None},
text = lambda tags, fields: {"en": ' '.join(filter(lambda x: x, [fields["adrl1_m"], fields["cp_m"], fields["ville_m"]]))} )))
"website": lambda res: None if not res["URL"] else res["URL"] if res["URL"].startswith('http') else 'https://' + res["URL"],
"phone": lambda res: "+33 " + res["Telephone"][1:] if res["Telephone"] and re_phone.match(res["Telephone"]) else None,
"name": lambda res: res["Nom_officiel"][0].upper() + res["Nom_officiel"][1:] if res["Nom_officiel"] else res["Nom_officiel"][0].upper() + res["Nom_officiel"][1:] if res["Nom_officiel"] else None},
text = lambda tags, fields: {"en": ' '.join(filter(lambda x: x, [fields["Adresse"], fields["Lieu"], fields["Code_postal"], fields["Ville"]]))} )))

0 comments on commit 6c4618a

Please sign in to comment.