MCPcopy Index your code
hub / github.com/SpaceZephyr/myskill / parse

Method parse

workingnomads-scraper/scripts/parser.py:20–41  ·  view source on GitHub ↗

解析单条职位数据

(self, raw_job: dict)

Source from the content-addressed store, hash-verified

18 }
19
20 def parse(self, raw_job: dict) -> dict:
21 """解析单条职位数据"""
22 source = raw_job["_source"]
23
24 return {
25 "id": source.get("id"),
26 "title": source.get("title", "N/A"),
27 "company": source.get("company", "N/A"),
28 "category": source.get("category_name", "N/A"),
29 "location": self._format_location(source.get("locations")),
30 "position_type": self.POSITION_TYPES.get(
31 source.get("position_type", "ft"), "Full-time"
32 ),
33 "salary": self._format_salary(source),
34 "experience": self.EXPERIENCE_MAP.get(
35 source.get("experience_level", ""), "Not specified"
36 ),
37 "tags": source.get("tags", []) or [],
38 "description": self._clean_html(source.get("description", "")),
39 "apply_url": source.get("apply_url", ""),
40 "pub_date": self._format_date(source.get("pub_date")),
41 }
42
43 def _format_location(self, locations: list) -> str:
44 """格式化地点"""

Callers 15

parse_jobsFunction · 0.95
condense_xmlFunction · 0.80
validate_uuid_idsMethod · 0.80
validateMethod · 0.80
validate_deletionsMethod · 0.80
validate_insertionsMethod · 0.80

Calls 5

_format_locationMethod · 0.95
_format_salaryMethod · 0.95
_clean_htmlMethod · 0.95
_format_dateMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected