change encoding

This commit is contained in:
Crai-cry 2026-03-28 16:20:56 +03:00
parent 82b4b3094a
commit 2396d73b2f
2 changed files with 20 additions and 17 deletions

View File

@ -1,9 +1,9 @@
[
{
"id": 1,
"title": "Python ðàçðàáîò÷èê",
"company": "ßíäåêñ",
"city": "Ìîñêâà",
"title": "Python разработчик",
"company": "Яндекс",
"city": "Москва",
"salary_from": 150000,
"salary_to": 200000,
"skills": ["Python", "SQL", "Django", "PostgreSQL"],
@ -12,8 +12,8 @@
{
"id": 2,
"title": "Data Engineer",
"company": "Òèíüêîôô",
"city": "Ìîñêâà",
"company": "Тинькофф",
"city": "Москва",
"salary_from": 180000,
"salary_to": 250000,
"skills": ["Python", "SQL", "Spark", "Airflow"],
@ -23,7 +23,7 @@
"id": 3,
"title": "Backend Developer",
"company": "Ozon",
"city": "Ñàíêò-Ïåòåðáóðã",
"city": "Санкт-Петербург",
"salary_from": 130000,
"salary_to": 170000,
"skills": ["Python", "FastAPI", "MongoDB"],
@ -32,8 +32,8 @@
{
"id": 4,
"title": "Data Analyst",
"company": "ßíäåêñ",
"city": "Ìîñêâà",
"company": "Яндекс",
"city": "Москва",
"salary_from": 140000,
"salary_to": 180000,
"skills": ["Python", "SQL", "Tableau"],
@ -42,8 +42,8 @@
{
"id": 5,
"title": "Junior Python Developer",
"company": "Ñáåð",
"city": "Ìîñêâà",
"company": "Сбер",
"city": "Москва",
"salary_from": 100000,
"salary_to": 130000,
"skills": ["Python", "SQL", "Git"],
@ -53,7 +53,7 @@
"id": 6,
"title": "Senior Python Developer",
"company": "Wildberries",
"city": "Ìîñêâà",
"city": "Москва",
"salary_from": 200000,
"salary_to": 300000,
"skills": ["Python", "SQL", "Kafka", "Kubernetes"],
@ -63,7 +63,7 @@
"id": 7,
"title": "Full Stack Developer",
"company": "Avito",
"city": "Ìîñêâà",
"city": "Москва",
"salary_from": 170000,
"salary_to": 220000,
"skills": ["Python", "JavaScript", "React", "SQL"],

View File

@ -12,9 +12,9 @@ def filter_by_city(vacancies: list[dict], city: str) -> list[dict]:
def filter_by_skills(vacancies: list[dict], required_skills: list[str]) -> list[dict]:
return [i for i in vacancies if all(skill.lower() in set(k.lower() for k in i.get('skills')) for skill in required_skills ) ]
def filter_by_salary(vacancies: list[dict], min_salary: int) -> list[dict]:
return [v for v in vacancies if v.get('salary_to') and v.get('salary_from') and v.get('salary_to')>= min_salary and v.get('salary_form')> min_salary]
return [v for v in vacancies if v.get('salary_to') and v.get('salary_from') and v.get('salary_to')>= min_salary and v.get('salary_from')> min_salary]
def extract_unique_companies(vacancies: list[dict]) -> list[str]:
return {v.get('company') for v in vacancies if v.get('company')}
return list({v.get('company') for v in vacancies if v.get('company')})
def extract_top_skills(vacancies: list[dict], top_n: int) -> list[tuple[str, int]]:
all_skills = []
for v in vacancies:
@ -72,7 +72,10 @@ def main():
skils_list.append(input(f"Write №{i + 1} skill: "))
filered_vacancies=filter_by_skills(filered_vacancies,skils_list)
filered_vacancies = filter_by_salary(filered_vacancies,int(input("Write salary: ")))
print(format_vacancy_short(x) for x in filered_vacancies)
print("Уникальные компании: ", ", ".join(extract_unique_companies(filered_vacancies)))