Ergani Python SDK¶
ergani.client¶
- class ergani.client.ErganiClient(username: str, password: str, base_url: str | None = 'https://trialeservices.yeka.gr/WebServicesAPI/api')[source]¶
Bases:
objectA client for interacting with the Ergani API
- Parameters:
str (base_url) – The username for authentication with Ergani
str – The password for authentication with Ergani
str – The base URL of the Ergani API. Defaults to “https://trialeservices.yeka.gr/WebServicesAPI/api”.
- get_current_workforce(afm: str | None = None) List[CurrentWorkforceRecord][source]¶
Fetches current workforce records from the Ergani API.
- Parameters:
afm (Optional[str]) – Optional employee tax identification number filter.
Noneomits theafmkey from the request payload. An empty string is serialized as{"afm": ""}.- Returns:
Current workforce records, each wrapping the raw response object returned by the API.
- Return type:
List[CurrentWorkforceRecord]
- Raises:
APIError – An error occurred while communicating with the Ergani API
AuthenticationError – Raised if there is an authentication error with the Ergani API
- get_services_list() Response | None[source]¶
Fetches the available services list from the Ergani API.
- Returns:
The raw response returned by the services list endpoint.
- Return type:
Optional[Response]
- Raises:
APIError – An error occurred while communicating with the Ergani API
AuthenticationError – Raised if there is an authentication error with the Ergani API
- submit_daily_schedule(company_daily_schedules: List[CompanyDailySchedule]) List[SubmissionResponse][source]¶
Submits schedule records that are updated on a daily basis for employees to the Ergani API
- Parameters:
List[CompanyDailySchedule] (company_daily_schedules) – A list of CompanyDailySchedule instances to be submitted
- Returns:
A list of SumbmissionResponse that were parsed from the API response
- Return type:
List[SubmissionResponse]
- Raises:
APIError – An error occurred while communicating with the Ergani API
AuthenticationError – Raised if there is an authentication error with the Ergani API
- submit_overtime(company_overtimes: List[CompanyOvertime]) List[SubmissionResponse][source]¶
Submits overtime records for employees to the Ergani API
- Parameters:
List[CompanyOvertime] (company_overtimes) – A list of CompanyOvertime instances to be submitted
- Returns:
A list of SumbmissionResponse that were parsed from the API response
- Return type:
List[SubmissionResponse]
- Raises:
APIError – An error occurred while communicating with the Ergani API
AuthenticationError – Raised if there is an authentication error with the Ergani API
- submit_weekly_schedule(company_weekly_schedules: List[CompanyWeeklySchedule]) List[SubmissionResponse][source]¶
Submits weekly schedule records for employees to the Ergani API
- Parameters:
List[CompanyWeeklySchedule] (company_weekly_schedules) – A list of CompanyWeeklySchedule instances to be submitted
- Returns:
A list of SumbmissionResponse that were parsed from the API response
- Return type:
List[SubmissionResponse]
- Raises:
APIError – An error occurred while communicating with the Ergani API
AuthenticationError – Raised if there is an authentication error with the Ergani API
- submit_work_card(company_work_cards: List[CompanyWorkCard]) List[SubmissionResponse][source]¶
Submits work card records (check-in, check-out) for employees to the Ergani API
- Parameters:
List[CompanyWorkCard] (company_work_cards) – A list of CompanyWorkCard instances to be submitted
- Returns:
A list of SumbmissionResponse that were parsed from the API response
- Return type:
List[SubmissionResponse]
- Raises:
APIError – An error occurred while communicating with the Ergani API
AuthenticationError – Raised if there is an authentication error with the Ergani API
ergani.exceptions¶
- exception ergani.exceptions.APIError(message: str | None = None, response: Response | None = None, payload: Dict[str, Any] | None = None)[source]¶
Bases:
ErrorRaised when an API request fails due to an unknown error
ergani.models¶
- class ergani.models.CompanyDailySchedule(business_branch_number: int, start_date: ~datetime.date | None = None, end_date: ~datetime.date | None = None, employee_schedules: ~typing.List[~ergani.models.EmployeeDailySchedule] = <factory>, related_protocol_id: str | None = '', related_protocol_date: ~datetime.date | None = None, comments: str | None = '')[source]¶
Bases:
objectRepresents daily schedule entries that are issued on a single business branch
- business_branch_number¶
The number identifying the business branch
- Type:
int
- start_date¶
The start date of the schedule
- Type:
Optional[date]
- end_date¶
The end date of the schedule period
- Type:
Optional[date]
- employee_schedules¶
A list of daily schedules for employees
- Type:
List[EmployeeDailySchedule]
The ID of the related protocol
- Type:
Optional[str]
The date of the related protocol
- Type:
Optional[date]
- comments¶
Additional comments regarding the daily schedule entries
- Type:
Optional[str]
- class ergani.models.CompanyOvertime(business_branch_number: int, sepe_service_code: str, business_primary_activity_code: str, business_branch_activity_code: str, kallikratis_municipal_code: str, legal_representative_tax_identification_number: str, employee_overtimes: ~typing.List[~ergani.models.Overtime] = <factory>, related_protocol_id: str | None = '', related_protocol_date: ~datetime.date | None = None, employer_organization: str | None = '', business_secondary_activity_code_1: str | None = '', business_secondary_activity_code_2: str | None = '', business_secondary_activity_code_3: str | None = '', business_secondary_activity_code_4: str | None = '', comments: str | None = '')[source]¶
Bases:
objectRepresents overtime entries that are issued on a single business branch
- business_branch_number¶
The number identifying the specific business branch
- Type:
int
- sepe_service_code¶
The SEPE service code
- Type:
str
- business_primary_activity_code¶
The primary activity code of the business
- Type:
str
- business_branch_activity_code¶
The activity code for the specific branch
- Type:
str
- kallikratis_municipal_code¶
The kallikratis municipal code
- Type:
str
- legal_representative_tax_identification_number¶
Tax identification number of the legal representative
- Type:
str
Related protocol ID
- Type:
Optional[str]
The date of the related protocol
- Type:
Optional[date]
- employer_organization¶
The employer’s organization name
- Type:
Optional[str]
- business_secondary_activity_code_1¶
Secondary activity code 1
- Type:
Optional[str]
- business_secondary_activity_code_2¶
Secondary activity code 2
- Type:
Optional[str]
- business_secondary_activity_code_3¶
Secondary activity code 3
- Type:
Optional[str]
- business_secondary_activity_code_4¶
Secondary activity code 4
- Type:
Optional[str]
- comments¶
Additional comments related to the overtime entries
- Type:
Optional[str]
- class ergani.models.CompanyWeeklySchedule(business_branch_number: int, start_date: ~datetime.date, end_date: ~datetime.date, employee_schedules: ~typing.List[~ergani.models.EmployeeWeeklySchedule] = <factory>, related_protocol_id: str | None = '', related_protocol_date: ~datetime.date | None = None, comments: str | None = '')[source]¶
Bases:
objectRepresents weekly schedule entries that are issued on a single business branch
- business_branch_number¶
The number identifying the business branch
- Type:
int
- start_date¶
The start date of the weekly schedule
- Type:
date
- end_date¶
The end date of the weekly schedule
- Type:
date
- employee_schedules¶
A list of weekly schedules for employees
- Type:
List[EmployeeWeeklySchedule]
The ID of the related protocol
- Type:
Optional[str]
The date of the related protocol
- Type:
Optional[date]
- comments¶
Additional comments regarding the weekly schedule entries
- Type:
Optional[str]
- class ergani.models.CompanyWorkCard(employer_tax_identification_number: str, business_branch_number: int, comments: str | None = '', card_details: ~typing.List[~ergani.models.WorkCard] = <factory>)[source]¶
Bases:
objectRepresents work card entries that are issued on a single business branch
- employer_tax_identification_number¶
The employer’s tax identification number
- Type:
str
- business_branch_number¶
The number identifying the specific business branch
- Type:
int
- comments¶
Additional comments related to the work cards
- Type:
Optional[str]
- class ergani.models.CurrentWorkforceRecord(employee_tax_identification_number: 'str | None' = None, employee_last_name: 'str | None' = None, employee_first_name: 'str | None' = None, employee_father_first_name: 'str | None' = None, employee_mother_first_name: 'str | None' = None, birth_date: 'str | None' = None, sex: 'str | None' = None, nationality: 'str | None' = None, marital_status: 'str | None' = None, number_of_children: 'int | None' = None, tax_office: 'str | None' = None, unemployment_card_code: 'str | None' = None, social_security_registry_number: 'str | None' = None, social_security_number: 'str | None' = None, address: 'str | None' = None, postal_code: 'str | None' = None, phone_number: 'str | None' = None, kallikratis_municipal_code: 'str | None' = None, underage_work_book_number: 'str | None' = None, identity_document_type: 'str | None' = None, identity_document_number: 'str | None' = None, identity_document_issuing_authority: 'str | None' = None, identity_document_issue_date: 'str | None' = None, residence_permit_installment: 'str | None' = None, residence_permit_installment_number: 'str | None' = None, residence_permit_approval: 'str | None' = None, residence_permit_approval_number: 'str | None' = None, residence_permit_visa: 'str | None' = None, residence_permit_visa_number: 'str | None' = None, branch_number: 'int | None' = None, employment_start_date: 'str | None' = None, specialty: 'str | None' = None, employee_classification: 'str | None' = None, profession_code: 'str | None' = None, weekly_workdays: 'str | None' = None, prior_experience: 'str | None' = None, employment_relationship: 'str | None' = None, responsible_position: 'str | None' = None, employment_status: 'str | None' = None, weekly_hours: 'str | None' = None, working_schedule: 'str | None' = None, break_schedule: 'str | None' = None, workplace: 'str | None' = None, workplace_comments: 'str | None' = None, wage_payment_frequency: 'str | None' = None, unpredictable_work_schedule: 'str | None' = None, on_demand_days_and_hours: 'str | None' = None, on_demand_minimum_notification: 'str | None' = None, on_demand_notes: 'str | None' = None, mandatory_training: 'str | None' = None, applicable_collective_agreement: 'str | None' = None, applicable_collective_agreement_comments: 'str | None' = None, working_time_arrangement: 'str | None' = None, working_time_arrangement_comments: 'str | None' = None, gross_pay: 'str | None' = None, hourly_pay: 'str | None' = None, primary_insurance: 'str | None' = None, supplementary_insurance: 'str | None' = None, additional_insurance_benefits: 'str | None' = None, trial_period: 'str | None' = None, borrowing_company_tax_identification_number: 'str | None' = None, change_date: 'str | None' = None, education_level: 'str | None' = None, professional_education: 'str | None' = None, pc_provided: 'str | None' = None, working_time_digital_organization: 'str | None' = None, full_employment_hours: 'str | None' = None, break_minutes: 'int | None' = None, break_within_schedule: 'str | None' = None, working_card: 'str | None' = None, flexible_working_hours: 'str | None' = None, last_modified_date: 'str | None' = None, raw_payload: 'Dict[str, Any]' = <factory>)[source]¶
Bases:
object
- class ergani.models.EmployeeDailySchedule(employee_tax_identification_number: str, employee_last_name: str, employee_first_name: str, schedule_date: ~datetime.date, workday_details: ~typing.List[~ergani.models.WorkdayDetails] = <factory>)[source]¶
Bases:
objectRepresents a daily schedule entry for an employee
- employee_tax_identification_number¶
The employee’s tax identification number
- Type:
str
- employee_last_name¶
The employee’s last name
- Type:
str
- employee_first_name¶
The employee’s first name
- Type:
str
- schedule_date¶
The date of the schedule
- Type:
date
- workday_details¶
A list of workday detail entries for the employee
- Type:
List[WorkdayDetails]
- class ergani.models.EmployeeWeeklySchedule(employee_tax_identification_number: str, employee_last_name: str, employee_first_name: str, schedule_date: ~datetime.date, workday_details: ~typing.List[~ergani.models.WorkdayDetails] = <factory>)[source]¶
Bases:
objectRepresents a weekly schedule entry for an employee
- employee_tax_identification_number¶
The employee’s tax identification number
- Type:
str
- employee_last_name¶
The employee’s last name
- Type:
str
- employee_first_name¶
The employee’s first name
- Type:
str
- schedule_date¶
The date of the schedule
- Type:
date
- workday_details¶
A list of workday detail entries for the week
- Type:
List[WorkdayDetails]
- class ergani.models.Overtime(employee_tax_identification_number: str, employee_social_security_number: str, employee_last_name: str, employee_first_name: str, overtime_date: date, overtime_start_time: time, overtime_end_time: time, overtime_cancellation: bool, employee_profession_code: str, overtime_justification: Literal['ACCIDENT_PREVENTION_OR_DAMAGE_RESTORATION', 'URGENT_SEASONAL_TASKS', 'EXCEPTIONAL_WORKLOAD', 'SUPPLEMENTARY_TASKS', 'LOST_HOURS_SUDDEN_CAUSES', 'LOST_HOURS_OFFICIAL_HOLIDAYS', 'LOST_HOURS_WEATHER_CONDITIONS', 'EMERGENCY_CLOSURE_DAY', 'NON_WORKDAY_TASKS'], weekly_workdays_number: Literal[5, 6], asee_approval: str | None = '')[source]¶
Bases:
objectRepresents an overtime entry for an employee
- employee_tax_identification_number¶
The employee’s tax identification number
- Type:
str
- employee_social_security_number¶
The employee’s social security number
- Type:
str
- employee_last_name¶
The last name of the employee
- Type:
str
- employee_first_name¶
The first name of the employee
- Type:
str
- overtime_date¶
The date of the overtime
- Type:
date
- overtime_start_time¶
The start time of the overtime period
- Type:
time
- overtime_end_time¶
The end time of the overtime period
- Type:
time
- overtime_cancellation¶
Indicates if the overtime was cancelled or not
- Type:
bool
- employee_profession_code¶
The profession code of the employee
- Type:
str
- overtime_justification¶
The justification for the overtime
- Type:
OvertimeJustificationType
- weekly_workdays_number¶
The number of the employee’s working days in a week
- Type:
Literal[5, 6]
- asee_approval¶
The ASEE aproval
- Type:
Optional[str]
- class ergani.models.SubmissionResponse[source]¶
Bases:
TypedDictRepresents a submission response from the Ergani API
- submission_id¶
The unique identifier of the submission
- Type:
str
- protocol¶
The protocol associated with the submission
- Type:
str
- submission_date¶
The datetime of the submission
- Type:
datetime
- class ergani.models.WorkCard(employee_tax_identification_number: str, employee_last_name: str, employee_first_name: str, work_card_movement_type: Literal['ARRIVAL', 'DEPARTURE'], work_card_submission_date: date, work_card_movement_datetime: datetime, late_declaration_justification: Literal['POWER_OUTAGE', 'EMPLOYER_SYSTEMS_UNAVAILABLE', 'ERGANI_SYSTEMS_UNAVAILABLE'] | None = None)[source]¶
Bases:
objectRepresents a work card entry for an employee
- employee_tax_identification_number¶
The employee’s tax identification number
- Type:
str
- employee_last_name¶
The last name of the employee
- Type:
str
- employee_first_name¶
The first name of the employee
- Type:
str
- work_card_movement_type¶
The type of work card movement
- Type:
WorkCardMovementType
- work_card_submission_date¶
The date the work card was submitted
- Type:
date
- work_card_movement_datetime¶
The exact date and time of the work card movement
- Type:
datetime
- late_declaration_justification¶
The justification for the late declaration of the work card movement
- Type:
Optional[LateDeclarationJustificationType]
- class ergani.models.WorkdayDetails(work_type: Literal['WORK_FROM_OFFICE', 'WORK_FROM_HOME', 'REST_DAY', 'ABSENT'], start_time: time, end_time: time)[source]¶
Bases:
objectRepresents details of an employee’s workday
- work_type¶
The type of an employee’s work schedule
- Type:
ScheduleWorkType
- start_time¶
The start time of the workday
- Type:
time
- end_time¶
The end time of the workday
- Type:
time