API Reference

Office Api

Endpoint to serve complete offices.

This endpoint serves complete offices, and any legitimate bits of them. Queries may be either in json or as html queries. The response is negotiated according to the Accept: header of the request, and currently supports either application/json (for serialised objects) or text/html (for rendered objects).

Note that requesting parts of an office automatically suppresses requesting a page.

officiumdivinum.api.office.get_office()[source]
officiumdivinum.api.office.get_partlist(things)[source]

Get list of parts of any object.

Api provider

Bible API

officiumdivinum.api.bible.get_verses()[source]

API database functions

Handle database querying.

By abstracting it here we can just use dicts for testing.

officiumdivinum.api.database.assemble_martyrology(candidates: list, year: int)[source]

Assemble and resolve martyrolgy (easy, as we just stuff them together.)

Parameters
  • candidates (list : candidates for the day.)

  • year (int : year.)

officiumdivinum.api.database.eval_year(year, yearless)[source]
Parameters
  • year

  • yearless

  • as_list – (Default value = True)

officiumdivinum.api.database.get_office(office: str, calendar: str, datestr: str, language: str, translation: Optional[str])[source]

Get a particular office by calendar date.

Note that this currently just returns a made-up prime office.

Parameters
  • office (str : Office name to get.)

  • calendar (str : Calendar to use.)

  • datestr (str : Date (as string, to parse with dateutils).)

  • language (str : Main Language.)

  • translation (Union[str : Second Language.)

  • None] (Or not)

Returns

Office – An object based on Office() for the relevant office.

officiumdivinum.api.database.get_psalm(psalm, language, start=None, stop=None)[source]
officiumdivinum.api.database.init(app)[source]

Start database.

officiumdivinum.api.database.load_martyrology(app)[source]
officiumdivinum.api.database.load_psalms(app)[source]
officiumdivinum.api.database.martyrology_query(day, table)[source]
Parameters
  • day

  • table

officiumdivinum.api.database.raw_query(day, table)[source]

Query table for data on day.

Parameters
  • day

  • table

Martyrology API

officiumdivinum.api.martyrology.get_martyrology()[source]
officiumdivinum.api.martyrology.json_query(day, table)[source]

Testpage API

officiumdivinum.api.test_api.test_api_page()[source]

Update Server

This module is purely for testing and will be dropped before the final release. It recieves a webhook from Github and triggers an update of the development server.

Re-used from.

https://github.com/SwagLyrics/swaglyrics-backend/blob/35d23d0ba416e742e381da931d592ce6f58fc13f/issue_maker.py

which is under the MIT license.

officiumdivinum.api.update_server.is_valid_signature(x_hub_signature, data, private_key)[source]
officiumdivinum.api.update_server.webhook()[source]

Module contents

officiumdivinum.api.create_app(test_config=None)[source]

Create and configure flask app.

officiumdivinum.api.markdown_no_p(text)[source]

Wrap text in markdown without wrapping it in paragaph tags.