cl-feiertage

2026-11-29

Common Lisp library for calculating German and Austrian bank holidays

Upstream URL

github.com/wlbr/cl-feiertage

Author

Michael Wolber

License

MIT
README

cl-feiertage

cl-feiertage is a Common Lisp library for calculating German and Austrian bank holidays. It includes the calculation of the date of Easter and, more importantly, offers ways to retrieve public holidays for a state of Germany or Austria (=Bundesland).

The library is probably useful only for people realizing use cases with special requirements inside of Austria or Germany, such as shift schedules or capacity calculation.

Usage

There are two types of functions:

  • (feiertage:<feiertag> year) and
  • (feiertage:<region> year)

<feiertag> returns a feiertag struct. It carries the date of the holiday in the requested year plus the name of the holiday. <feiertag> may be any of the following:

neujahrepiphanias
heilige-drei-königeweltknuddeltag
internationaler-tag-des-gedenkens-an-die-opfer-des-holocaustweiberfastnacht
valentinstagkarnevalssonntag
rosenmontagfastnacht
aschermittwochinternationaler-frauentag
josefitagpalmsonntag
beginn-sommerzeitgründonnerstag
karfreitagostern
ostermontagtag-der-erde
walpurgisnachtstaatsfeiertag
tag-der-arbeitinternationaler-tag-der-pressefreiheit
star-wars-dayflorianitag
tag-der-befreiungmuttertag
vatertagchristi-himmelfahrt
pfingstenhandtuchtag
pfingstmontagtowel-day
dreifaltigkeitssonntaginternationaler-kindertag
fronleichnamweltumwelttag
tag-des-meeresweltspieltag
weltblutspendetagweltflüchtlingstag
fête-de-la-musiqueinternationaler-tag-gegen-drogenmissbrauch
system-administrator-appreciation-daymariä-himmelfahrt
antikriegstagweltkindertag
hobbit-dayrupertitag
tag-der-deutschen-einheiterntedankfest
tag-der-volksabstimmungbeginn-winterzeit
nationalfeiertaghalloween
reformationstagallerheiligen
allerseelenweltmännertag
martinstagkarnevalsbeginn
volkstrauertagleopolditag
buß-und-bettaginternationaler-männertag
totensonntagthanksgiving
blackfridayerster-advent
nikolauszweiter-advent
mariä-empfängnismariä-unbefleckte-empfängnis
dritter-adventvierter-advent
heiligabendchristtag
weihnachtenstefanitag
zweiter-weihnachtsfeiertagsilvester

<region> returns a region struct. It offers a list of public holidays valid in the specified state as well as the name and the shortname of the state as attributes. <region> may be any of:

baden-württembergbayernberlin
brandenburgbremenhamburg
hessenmecklenburg-vorpommernniedersachsen
nordrhein-westfalenrheinland-pfalzsaarland
sachsensachsen-anhaltschleswig-holstein
thüringendeutschlandburgenland
kärntenniederösterreichoberösterreich
salzburgsteiermarktirol
vorarlbergwienösterreich
all  

The region functions return the public holidays ("gesetzliche Feiertage"). The function all returns all defined "special dates", such as Penance Day (Buß- und Bettag) or the begin/end of daylight saving time.

The regional functions for Austrian Bundesländer include saints' days which are state-level holidays, meaning schools etc. are generally closed but workers don't get the day off by default. If you don't want to include these days in your planning, it's okay to reference österreich instead, as legal holidays are (more or less) synchronised across all Austrian states (Bundesländer).

Examples

(feiertage:ostern 2016)
--> #S(FEIERTAG :DATE 27.03.2016 :NAME "Ostern")

(feiertage:buß-und-bettag 2016)
--> #S(FEIERTAG :DATE 16.11.2016 :NAME "Buß- und Bettag")

(feiertage:brandenburg 2016)
--> Brandenburg (BB)
    01.01.2016 Neujahr
    25.03.2016 Karfreitag
    27.03.2016 Ostern
    28.03.2016 Ostermontag
    01.05.2016 Tag der Arbeit
    05.05.2016 Christi Himmelfahrt
    15.05.2016 Pfingsten
    16.05.2016 Pfingstmontag
    03.10.2016 Tag der deutschen Einheit
    31.10.2016 Reformationstag
    25.12.2016 Weihnachten
    26.12.2016 Zweiter Weihnachtsfeiertag

Installation

The most simple and recommended way to install cl-feiertage is by using Quicklisp. If you have Quicklisp installed, a simple

(ql:quickload :feiertage)

will download the package and load it. You only need to do this once per machine. Later a

(require :feiertage)

will be enough.

Alternatively you may get the code with:

git clone git://github.com/wlbr/cl-feiertage.git

Either you add this to your ASDF repository, then you will only need to do a (require :feiertage) in your source.

Or, you may put the source in a subdirectory of your project and add the file feiertage.asd with its full path to your own ASDF definition.

Or, you may put the source in a subdirectory of your project and load the file feiertage.asd directly. After that a (asdf:load-system "feiertage") should be sufficient.

Dependencies

xlunit for the unit tests only (the tests are not included in the asdf system definition).

Testing

Tested with SBCL and CCL. Should run in any standard Common Lisp environment.

A set of unit tests is included. To run them:

(asdf:test-system :feiertage)

License

MIT License. See included LICENSE file.

Reporting problems

If you run into any trouble or find bugs, please report them via the Github issue tracker.

Dependencies (3)

  • alexandria
  • local-time
  • xlunit

Dependents (0)

    • GitHub
    • Quicklisp