JobSpy/api/core/jobs/__init__.py

66 lines
1.2 KiB
Python
Raw Normal View History

2023-07-06 16:44:38 -07:00
from pydantic import BaseModel
from datetime import datetime
from enum import Enum
class JobType(Enum):
2023-07-07 19:00:59 -07:00
FULL_TIME = "full_time"
PART_TIME = "part_time"
2023-07-08 04:57:36 -07:00
CONTRACT = "contractor"
2023-07-07 19:00:59 -07:00
INTERNSHIP = "internship"
TEMPORARY = "temporary"
2023-07-08 04:57:36 -07:00
PER_DIEM = "per_diem"
NIGHTS = "nights"
2023-07-06 16:44:38 -07:00
class Location(BaseModel):
country: str
city: str
state: str
postal_code: str = None
address: str = None
2023-07-08 04:57:36 -07:00
class CompensationInterval(Enum):
YEARLY = "yearly"
MONTHLY = "monthly"
WEEKLY = "weekly"
DAILY = "daily"
HOURLY = "hourly"
2023-07-06 16:44:38 -07:00
class Compensation(BaseModel):
interval: CompensationInterval
2023-07-08 04:57:36 -07:00
min_amount: float
max_amount: float
currency: str = "US"
2023-07-06 16:44:38 -07:00
class DeliveryEnum(Enum):
2023-07-07 19:00:59 -07:00
EMAIL = "email"
URL = "url"
2023-07-06 16:44:38 -07:00
class Delivery(BaseModel):
method: DeliveryEnum
value: str
class JobPost(BaseModel):
title: str
2023-07-07 19:00:59 -07:00
description: str = None
2023-07-06 16:44:38 -07:00
company_name: str
location: Location
2023-07-08 04:57:36 -07:00
job_type: JobType = None
2023-07-07 19:00:59 -07:00
compensation: Compensation = None
2023-07-06 16:44:38 -07:00
date_posted: datetime
delivery: Delivery = None
2023-07-06 17:12:01 -07:00
class JobResponse(BaseModel):
job_count: int
2023-07-07 19:00:59 -07:00
page: int = 1
2023-07-06 17:12:01 -07:00
total_pages: int
2023-07-07 19:00:59 -07:00
jobs: list[JobPost]