Read the instructions for how to register
A data view is basically a list of metadata fields. If you are granted access to a data view, you can see all of the fields covered by that data view.
Every data view is associated with a short name, which we sometimes call a code
or Majora data view code (mdv
code).
Guidance on how to obtain access to a view is in progress, check back after the consortium agreement has been distributed. This document has been written ahead of time and we are not currently granting permissions to any restricted views. Do not attempt to contact anyone to arrange access at this time.
Ocarina is a command line tool that is used to connect to Majora and perform actions with elevated privileges that are not possible on the website. It is not terribly difficult to use, but ideally you will have used a command line tool before.
You can install the latest version with the Python package manager. You’ll probably want to install it into a conda environment on the shared node.
conda create -n mdv-ocarina python=3.7
conda activate mdv-ocarina
pip install git+https://github.com/samstudio8/ocarina.git
You must register an instance of Ocarina with Majora so that it can authenticate as you through OAuth. Read the instructions for registering an application.
Create a JSON file in your home directory named .ocarina
. Note the starting dot.
{"MAJORA_DOMAIN": "https://majora.covid19.climb.ac.uk/", "MAJORA_USER": "your-username", "MAJORA_TOKEN": "OAUTH", "CLIENT_ID": "your-client-id", "CLIENT_SECRET": "your-client-secret"}
Where:
MAJORA_DOMAIN
points to either the domain of the real, or test Majora. Do not miss the /
at the end of the URL.MAJORA_USER
is your username on the appropriate Majora instanceMAJORA_TOKEN
is set to OAUTH
(note that you will not be able to use the v2+
API without a rotating token)CLIENT_ID
is the Client ID of your registered applicationCLIENT_SECRET
is the Client Secret of your registered applicationOnce this has been set up, you are ready to retrieve data.
ocarina --oauth get dataview --mdv CODE --task-wait --output-table -o my_data.tsv
Replace CODE
with the appropriate data view name. Ocarina will reject your request if you attempt to access a data view you do not have permission to view.
Use the command exactly as stated (do not skip providing --task-wait
) for ease of use.
When you submit this command, you will need to authenticate yourself through the following process:
https://
) and paste it to your command line window.[WAIT] Giving Majora a minute to finish task
.-o
.This is an experimental feature and can change at any time. Please visit #metadata-apis
if you have questions or trouble.