-
Notifications
You must be signed in to change notification settings - Fork 6
APIs
CantusDB's APIs are defined in main_app/views/views.py
(code).
The CSV Export API is used to share information for all chants/sequences in a source in CSV format. It can be accessed via /csv/<source_id>
(for example, http://206.12.93.196/csv/123610). It corresponds to OldCantus's csv API.
Each row in the returned CSV file represents a single chant or sequence. It has the following columns:
-
siglum
: The value of the chant'ssiglum
field. A string. -
marginalia
: The value of the chant'smarginalia
field. A string. -
folio
: The value of the chant'sfolio
field. A string. -
sequence
: The value of the chant'ssequence_number
field. An integer. -
incipit
: The value of the chant'sincipit
field. A string. -
feast
: Thename
field of the chant's Feast. A string. -
office
: Thename
field of the chant's Office. A string. -
genre
: Thename
field of the chant's Genre. A string. -
position
: The value of the chant'sposition
field. A string. -
cantus_id
: The value of the chant'scantus_id
field. A string. -
mode
: The value of the chant'smode
field. A string. -
finalis
: The value of the chant'sfolio
field. A string. -
differentia
: The value of the chant'sdifferentia
field. A string. -
differentia_new
: The value of the chant'sdifferentia_new
field. A string. -
fulltext_standardized
: The value of the chant'smanuscript_full_text_std_spelling
field. A string. -
fulltext_ms
: The value of the chant'smanuscript_full_text
field. A string. -
volpiano
: The value of the chant'svolpiano
field. A string. -
image_link
: The value of the chant'smanuscript_full_text
field. A URL. -
melody_id
: The value of the chant'smelody_id
field. A string. -
cao_concordances
: The value of the chant'scao_concordances
field. A string. -
addendum
: The value of the chant'saddendum
field. A string. -
extra
: The value of the chant'sextra
field. A string. -
node_id
: The chant's ID. An integer.
The JSON Melody Export API exports information on all chants/sequences in the database with a given Cantus ID in JSON format. It can be accessed via /json-melody/<cantus_id>
(for example, http://206.12.93.196/json-melody/002085). It corresponds to OldCantus's json-melody API. It corresponds to OldCantus's json-melody API.
The JSON Node Export API exports all information on a Chant, Sequence, Source or Indexer in JSON format. It can be accessed via /json-node/<id>
(for example, http://206.12.93.196/json-node/123610). It corresponds to OldCantus's json-node API.
The JSON Sources Export API exports information on each published source in the database in JSOn format. For each source, it includes the source's id
along with a link to the source's CSV Export. It can be accessed via /json-sources
(for example, http://206.12.93.196/json-sources/). It corresponds to OldCantus's json-sources API.
The JSON Next Chants API exports information on which chants tend to follow chants with a given Cantus ID. It returns a list of Cantus IDs along with a tally of how many times chants with that Cantus ID followed chants with the given Cantus ID in the database. It can be accessed via /json-nextchants/<cantus_id>
(for example, http://206.12.93.196/json-nextchants/007840b). It corresponds to OldCantus's json-nextchants API.
Corresponds to CantusDB's csv_export API. It can be accessed via /sites/default/files/csv/<source_id>
(for example, https://cantus.uwaterloo.ca/sites/default/files/csv/123610).
Corresponds to CantusDB's json_melody_export API. It can be accessed via /json-melody/<cantus_id>
(for example, https://cantus.uwaterloo.ca/json-melody/002085).
Corresponds to CantusDB's json_node_export API. It can be accessed via /json-node/<pk>
(for example, https://cantus.uwaterloo.ca/json-node/123610).
OldCantus's json-node
API is used extensively in the scripts used to migrate data from OldCantus to Cantus DB.
Corresponds to CantusDB's json_sources API. It can be accessed via /json-sources/
(for example, https://cantus.uwaterloo.ca/json-sources/).
Corresponds to CantusDB's json_nextchants API. It can be accessed via /json-nextchants/<cantus_id>
(for example, http://cantus.uwaterloo.ca/json-nextchants/007840b).