https://github.com/simoncw/roster2cal
Convert a roster from excel or pdf to convenient calendar formats.
https://github.com/simoncw/roster2cal
Last synced: about 1 month ago
JSON representation
Convert a roster from excel or pdf to convenient calendar formats.
- Host: GitHub
- URL: https://github.com/simoncw/roster2cal
- Owner: SimonCW
- License: apache-2.0
- Created: 2021-11-14T14:46:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-02T17:24:58.000Z (over 4 years ago)
- Last Synced: 2025-06-06T06:41:10.591Z (12 months ago)
- Language: Jupyter Notebook
- Size: 148 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Roster2cal
> Convert a roster defined in an excel to an ics file. Note: This is a personal project to save myself and my wife the time of manually adding her work shifts from an Excel/PDF roster to our shared Google Calendar.
The input is a roster defined in an excel file that looks similar to the screenshot below. The output is an ics file that can be imported to most calendars.
(see [full example here](data/202201_example_roster.xlsx))
As a secondary purpose, I needed a small project to try out nbdev for development :).
## Install
`pip install roster2ical`
## How to use
```
from pathlib import Path
from roster2ical.roster import ShiftProperties, Roster
from datetime import timedelta
_abbr2shiftproperties = {
"F1": ShiftProperties(
name="Früh1", starting_hour=timedelta(hours=8), duration=timedelta(hours=8)
),
"N1": ShiftProperties(
name="Nacht1", starting_hour=timedelta(hours=22), duration=timedelta(hours=10)
),
}
r = Roster.from_dict(
{
"Mo 01": "F1",
"Di 02": "N1",
},
mapper=_abbr2shiftproperties,
)
with (Path.cwd() / "data" / "output" / "example.ics").open("w") as f:
f.write(str(r.to_ics()))
```
# ToDos
- [ ] ics converts everything to UTC, this somehow messes up the times when editing imported dates into Google Cal https://github.com/ics-py/ics-py/issues/188
- [ ] Add new shift types, e.g. RTH
- [ ] Add secondary shift label, e.g. HG as "Hintergrund"
- [ ] For private use, write module to push directly to Google Calendar (set color, etc)