You've already forked RekomenciBackend
31 lines
654 B
Python
31 lines
654 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
from adaptix import DebugTrail, NameStyle, Retort, name_mapping
|
|
|
|
from dataset.data_structures import DataSetLine, Salary
|
|
|
|
retort = Retort(
|
|
recipe=[
|
|
name_mapping(Salary, name_style=NameStyle.CAMEL),
|
|
],
|
|
debug_trail=DebugTrail.DISABLE,
|
|
strict_coercion=False,
|
|
)
|
|
|
|
raw_lines = []
|
|
with Path("hh_ru_vacancies.jsonlines").open("r", encoding="utf-8") as f:
|
|
raw_lines = map(json.loads, f.readlines())
|
|
|
|
lines = retort.load(raw_lines, list[DataSetLine])
|
|
f = set()
|
|
c = 0
|
|
for line in lines:
|
|
if c == 1000:
|
|
break
|
|
if line.experience:
|
|
f.add(line.experience)
|
|
c += 0
|
|
|
|
print(f)
|