discordschedule.py
is a Python script for creating formatted schedules for Discord. It takes a text file containing a schedule and outputs a formatted version configured in a JSON file.
discordschedule.py [-h] [-f json] [-nw [N]] schedule.txt
schedule.txt
- Path to the text file containing the schedule.
-h
,--help
- Show the help message and exit.-f json
,--format json
- Specify a JSON file for formatting settings. Default:schedule.json
.-nw [N]
,--next-week [N]
- If this option is omitted the schedule will be set to the current week. If enabled the schedule will be generated for the N-th week from now. IfN
is not specified it defaults to1
(next week's schedule).
Create a JSON file (schedule.json
) that contains settings for the schedule's appearance. See example in schedule.example.json.
heading
- the text that will be put at the top of the scheduledate format
- format dates in{startdate}
and{enddate}
used inheading
. Time format codes: https://docs.python.org/3/library/datetime.html#format-codesstandard time
- the standard streaming timeoffline
- a keyword used to identify days without streams. Alternatively an empty line can be placed in the input file.live format
- format for stream timestamp for discordlive url format
- format for stream timestamp with the stream URL. This will be used when the URL is specified (see Input File)stream delimiter
- used to separate multiple streams that happen in one daytime delimiter
- used to specify custom streaming timetimezones
- list the time zone abbreviations and their offset from UTC
The input schedule (schedule.txt
) should list streams. See example in schedule.example.txt.
- Each line corresponds to a weekday: 1 - for Monday, 7 - for Sunday.
- Otionaly a URL to the waiting room/live stream can be provided right after the stream title.
- If there are multiple streams in one day separate them with the
stream delimiter
in schedule.json (by default;
). - Specify live stream time after a
time delimiter
in schedule.json (by default,
). If the time zone is omitted UTC is assumed. If the time is not specified thestandard time
in schedule.json will be used. For date/time format details see https://dateutil.readthedocs.io/en/stable/parser.html - Everything after
#
will be ignored.