JobSpy/api/core/jobs/__init__.py

70 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 = None
state: str = None
2023-07-06 16:44:38 -07:00
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
company_name: str
location: Location
description: str = None
2023-07-08 04:57:36 -07:00
job_type: JobType = None
2023-07-07 19:00:59 -07:00
compensation: Compensation = None
date_posted: datetime = None
2023-07-06 16:44:38 -07:00
delivery: Delivery = None
2023-07-06 17:12:01 -07:00
class JobResponse(BaseModel):
success: bool
error: str = None
total_pages: int = None
job_count: int = None
page: int = None
jobs: list[JobPost] = []
2023-07-07 19:00:59 -07:00