Convert an airline crew schedule pdf into iCalendar format.
Project description
crewcal
Convert an airline crew schedule pdf into iCalendar format using a machine learning Large Language Model.
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
About the Project
Convert an airline crew schedule pdf into iCalendar format using a machine learning Large Language Model. An LLM (Large Language Model, specifically OpenAI's gpt-3.5-turbo) 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.
Getting Started
Prerequisites
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.
Installation
Strongly consider using pipx or a virtual environment depending on your needs.
pip install crewcal
Usage
CLI
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.
Python Package
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.
Roadmap
- Add support schedules for systems in addition to AIMS. I would be happy to look at suggestions, especially if you can provide sample schedules. Create a new issue.
Contributing
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
Contact
Project Link: crewcal
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file crewcal-0.8.2.tar.gz
.
File metadata
- Download URL: crewcal-0.8.2.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.4 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19edf1544b9cc96f8ea64cb4d851194541b1c31d2f89dc7f9fd1ac0da2cf5ddd |
|
MD5 | 43480a43e48698ac414fde86b0a1fef9 |
|
BLAKE2b-256 | b69ccbc71035cde62587b45bf21b7d058f58b961409f1a409bddfcb51371f1f3 |
File details
Details for the file crewcal-0.8.2-py3-none-any.whl
.
File metadata
- Download URL: crewcal-0.8.2-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.4 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63793f6248c4fc758ac6c66902bda7225269d6e48757f7695258517d333ac1cd |
|
MD5 | 45105612164df4d34ef6404b187efb4c |
|
BLAKE2b-256 | 44795878ab1b94e9b246307cb8505146e38f36abb440827004e325f4a0a74dc2 |