예제 #1
0
 def normalise(self, data, uri, view_date):
     ans = super().normalise(data, uri, view_date)
     salary_raw = data["baseSalary"]["value"].get("value")
     salary = get_salary_data(salary_raw)
     location_raw = location_jsonld(data)
     return {
         **ans,
         **salary,
         "location_raw": location_raw,
         **AU_GEOCODER.geocode(location_raw),
     }
예제 #2
0
 def normalise(self, *args, **data) -> Dict[str, Any]:
     return {
         "title": data["job_title"],
         "description": data["job_description"],
         "uri": data["page_url"],
         # Not quite true; this is date added
         "view_date": datetime.datetime.strptime(data["date_added"],
                                                 "%d/%m/%Y"),
         **get_salary_data(data["salary"]),
         "location_raw": data["location"],
         **AU_GEOCODER.geocode(data["location"]),
     }
예제 #3
0
 def normalise(self, data, uri, view_date):
     metadata = {row["value"]: row["name"] for row in data["mainAttributes"]}
     salary_raw = metadata.get("Salary Detail")
     salary_data = get_salary_data(salary_raw)
     return {
         "title": data["title"],
         "description": html2plain(data["description"]),
         "uri": uri,
         "view_date": datetime_from_iso_utc(view_date),
         "org": None,
         **salary_data,
         "location_raw": data["mapAddress"],
         **AU_GEOCODER.geocode(data["mapAddress"]),
     }
예제 #4
0
 def normalise(self, title, description, metadata, uri, view_date):
     salary = get_salary_data(
         metadata.get("Total Remuneration Package:") or "")
     location_raw = metadata["Job Location:"]
     return {
         "title": title,
         "description": html2plain(description),
         "uri": uri,
         "view_date": datetime_from_iso_utc(view_date),
         "org": metadata["Organisation/Entity:"],
         **salary,
         "location_raw": location_raw,
         **AU_GEOCODER.geocode(fixup_iworkfornsw_loc(location_raw)),
     }
예제 #5
0
 def normalise(self, title, description, metadata, uri, view_date):
     salary_data = get_salary_data(
         metadata.get("Salary:") or metadata["Salary Range:"]
     )
     location_raw = metadata.get("Location:") or metadata["Work location:"]
     return {
         "title": title,
         "description": html2plain(description),
         "uri": uri,
         "view_date": datetime_from_iso_utc(view_date),
         "org": metadata.get("Organisation:"),
         **salary_data,
         "location_raw": location_raw,
         **AU_GEOCODER.geocode(fixup_careers_vic_location(location_raw)),
     }
예제 #6
0
 def normalise(
     self, title, description, organisation_description, metadata, uri, view_date
 ):
     salary_text = metadata.get("Salary :")
     salary_data = get_salary_data(salary_text)
     location_raw = metadata["Location :"]
     return {
         "title": title,
         "description": html2plain(description),
         "uri": uri,
         "view_date": datetime_from_iso_utc(view_date),
         "org": metadata.get("Organisation :"),
         **salary_data,
         "location_raw": location_raw,
         **AU_GEOCODER.geocode(fix_probono_location(location_raw)),
     }
예제 #7
0
 def normalise(self, data, uri, view_date):
     salary_text = data["salary"]
     location = data["locationHierarchy"]
     location_text = ", ".join([
         location["suburb"],
         location["city"],
         location["state"],
         location["nation"],
     ])
     return {
         "title": data["title"],
         "description": html2plain(data["mobileAdTemplate"]),
         "uri": uri,
         "view_date": datetime_from_iso_utc(view_date),
         "org": data["advertiser"]["description"],
         **get_salary_data(salary_text),
         "location_raw": location_text,
         **AU_GEOCODER.geocode(location_text),
     }
예제 #8
0
 def normalise(self, *args, **data) -> Dict[str, Any]:
     location_text = ", ".join([
         data["city"],
         data["state"],
         data.get("country") or data["inferred_country"],
     ])
     salary_text = data.get("salary_offered")
     return {
         "title":
         data["job_title"],
         "description":
         data["job_description"],
         "uri":
         data["url"],
         "view_date":
         datetime.datetime.strptime(data["crawl_timestamp"],
                                    "%Y-%m-%d %H:%M:%S +0000"),
         "org":
         data["company_name"],
         **get_salary_data(salary_text),
         "location_raw":
         location_text,
         **AU_GEOCODER.geocode(location_text),
     }
예제 #9
0
 def normalise(self, *args, **data) -> Dict[str, Any]:
     parts = [
         x for x in [data.get("city"),
                     data.get("state"),
                     data.get("geo")] if x
     ]
     location_text = ", ".join(parts)
     return {
         "title":
         data["job_title"],
         "description":
         data["job_description"],
         "uri":
         data["pageurl"],
         "view_date":
         datetime.datetime.strptime(data["crawl_timestamp"],
                                    "%Y-%m-%d %H:%M:%S +0000"),
         "org":
         data["company_name"],
         **get_salary_data(data.get("salary_offered")),
         "location_raw":
         location_text,
         **AU_GEOCODER.geocode(location_text),
     }