igneus / calendarium-romanum

liturgical calendar library (Roman Catholic, post-Vatican II)
50 stars 21 forks source link

Sanctorale data files: loading mechanism not relying on relative paths (only) #77

Open igneus opened 3 years ago

igneus commented 3 years ago

Since 0.7.0 there is method SanctoraleFactory.load_with_parents, recursively loading and correctly merging parent calendars specified in each file's YAML front matter. The only supported way to refer to a parent data file is by it's path relative to the current file. But there are scenarios when the library's user will want to be able to refer to well-known data files without knowing their relative filesystem path - e.g. to the data files bundled in calendarium-romanum. (There is already an example in the wild: some of the data files in https://github.com/calendarium-romanum/data-contrib need such references.) For cases like this, there should be an alternative parent loading method, looking for parent calendars in some sort of a repository object rather than interacting directly with the filesystem.

The repository mechanism should be flexible and (based on how the repository object is constructed) allow any combination of