Convert an airline crew schedule pdf into iCalendar format using a Large Language Model.
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
Convert an airline crew schedule pdf into iCalendar format using a Large Language Model. OpenAI's gpt-4o-mini is used to extract the schedule information. iCalender files are recognized by most calendar systems (iOS, Android, Google, ++) and will create the flights on your phone/device calendar.
The PDF schedule does not need to follow a very prescribed structured format.
Development performed mostly using AIMS eCrew pdf schedules. It may work on other systems' schedules. Feel free to suggest other systems.
Obtain an OpenAI API key.
Make this available as an environment variable:
export OPENAI_API_KEY=YOUR_KEY
Alternatively specify the API key in a .env file.
Strongly consider using pipx or a virtual environment depending on your needs.
pip install crewcal
To create the calendar file (schedule.ics) from a pdf schedule file (schedule.pdf):
crewcal extract schedule.pdf schedule.ics
crewcal --help
shows a brief manual page.
The following sript extracts the schedule from schedule.pdf
and stores the icalendar file in schedule.ics
file.
from crewcal.llm_extract import OpenAISchedule
sched = OpenAISchedule(schedule_path='schedule.pdf', to_icalendar_file='schedule.ics')
The resulting .ics file can be read by most calendar software.
- Add support for schedules from systems in addition to AIMS. I would be happy to look at suggestions, especially if you can provide sample schedules. Create a new issue to initiate a new request.
Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also open a feature request or bug report. Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Project Link: crewcal