GithubHelp home page GithubHelp logo

classicvalues / missal1962 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mmolenda/missalemeum

1.0 1.0 0.0 15.04 MB

1962 Roman Catholic Missal for the Traditional Latin Mass

Home Page: https://www.missalemeum.com

License: MIT License

Python 82.55% HTML 7.50% CSS 2.51% JavaScript 7.22% Dockerfile 0.21%

missal1962's Introduction

Missale Meum

1962 Roman Catholic Missal for the Traditional Latin Mass.

The application consists of Python/Flask API, serving calendar and propers for a given day, and Bootstrap UI consuming and presenting the data. The application utilizes data files from Divinum Officium, which is linked through a git submodule.

Features

  • Calculates the 1962 calendar for given liturgical year
  • Shows Proprium Missae (variable parts of the Mass) for a given date
  • Provides Ordo Missae (fixed parts of the Mass)
  • Exposes calendar in iCal format
  • Shows everything in a slick, responsive UI

At the moment the application supports English and Polish vernacular languages. As the data for many other languages is available in Divinum Officium, it is relatively easy to support them. Volunteers are welcome to contribute (see below).

Running the application

Prerequisites

  • Python >=3.6

Installation

Clone the repository using --recursive switch to also fetch divinum-officium as a submodule - it's used to display propers.

Create a virtualenv and install dependencies pip install -r requirements.txt.

Configuration

By default the application is using lru_cache to cache responses from missalemeum.controller functions (which are used by missalemeum.api to fetch the data).

To disable caching one need to set environment variable MISSAL_NO_CACHE to True

Run the development API

$ python missalemeum/app.py

and navigate to http://0.0.0.0:5000/.

API specficiation

See openapi.yaml or auto-generated swagger API documentation based on the latter.

Docker

Docker setup copies only the necessary files from Divinum Officium to keep the image light and serves the application using Gunicorn.

$ docker build -t missalemeum .
$ docker run -d -p 8000:8000 missalemeum

and navigate to http://0.0.0.0:8000/.

Running tests in Docker

Build the image. Run docker run missalemeum sh -c "pytest tests"

Command line (CLI)

Calculate the calendar

# current year
$ python missalemeum/cli.py calendar

# selected year
$ python missalemeum/cli.py calendar 2020

Show Proprium Missae for given date

$ python missalemeum/cli.py date 2018-05-03

Show Proprium Missae for given observance

Observance ID can be obtained from calendar's output

# Second Sunday of Advent
$ python missalemeum/cli.py proper tempora:Adv2-0:1:v

# The Seven Dolors of the Blessed Virgin Mary
$ python missalemeum/cli.py proper sancti:09-15:2:w

Localization

  1. Copy folder missalemeum/constants/en into missalemeum/constants/<your-lang-ISO-639-1> and translate the files
  2. Add mapping between your language ISO-639-1 code and Divinum Officium language folder in LANGUAGES in missalemeum/constants/common.py
  3. Generate Babel language files:
    • Create .po file: cd missalemeum/missalemeum && pybabel init -i messages.pot -d translations -l <your-lang-ISO-639-1>
    • Provide translations in file generated in missalemeum/translations/<your-lang>/LC_MESSAGES/messages.po
    • Compile babel files: pybabel compile -d translations
  4. Copy folder missalemeum/templates/en into missalemeum/templates/<your-lang-ISO-639-1> and translate the files
  5. Copy folder missalemeum/static/data/en into missalemeum/static/data/<your-lang-ISO-639-1> and translate the files
  6. Copy folder missalemeum/static/js/en into missalemeum/static/js/<your-lang-ISO-639-1> and translate the files
  7. Run the application and verify everything is being displayed properly. Check at least one full year from now. Most likely you'll encounter some issues with Divinum Officium source files. In such case correct them in Divinum Officium project and update the submodule.
  8. Add source files for non-regular Masses, like Ash Wednesday or Maundy Thursday in resources/divinum-officium-custom/web/www/missa/<your-lang>

Dev info

kalendar.factory.MissalFactory#create instantiates and builds kalendar.models.Calendar object.

kalendar.models.Calendar internally keeps the data in an ordered dict where a key is a datetime.date object, and the value is an instance of kalendar.models.Day class.

Each kalendar.models.Day contains three list properties, tempora, celebration and commemoration, each one containing kalendar.models.Observance objects, representing given observance. tempora refers to the liturgical time, such as "The first Friday after Pentecost", celebration holds kalendar.models.Observances that are actually celebrated in given day, such as "Assumption of Mary". commemoration contains objects representing observances that should be commemorated with the main celebration.

Each kalendar.models.Day has method get_proper, which calculates the actual readings in vernacular and Latin for given calendar day.

Each kalendar.models.Observance has method get_proper, which returns the readings for the given observance (regardless of its place in the calendar).

Tests

Add missalemeum and tests directories to the PYTHONPATH environment variable and use pytest.

Or in the root directory set an alias for pytest: alias pytest="PYTHONPATH=$(pwd)/missalemeum:$(pwd)/tests pytest"

missal1962's People

Contributors

mmolenda avatar caseneuve avatar dependabot[bot] avatar benyanke avatar filiplajszczak avatar

Stargazers

Classic Values avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.