Using Lens.org APIs and datasets.
sequenceDiagram
Actor User
User ->>+Lens.org: Request access via form
loop Form
Lens.org->>Lens.org: Process form
end
Lens.org->>+User: email with access details
- Sign in using your KAUST email.
- Select the type of API or bulk data you are interested in and click
Request Access
to access the online application form. - Apply by completing the online application. Make sure to provide accurate information about your use case, affiliation and organization.
- Upon submission you will receive a confirmation email that your application is now being processed.
- Your application is received by the Lens team and will be evaluated based on the use-case, commercial or non-commercial use, affiliation or organization size/type. We may contact you for additional information to help in the evaluation.
- If your application is approved, you will receive another confirmation email that will include instructions on how to access your API token to obtain the data.
The first step to use the Lens.org API is to request token. See the below.
Once you have your token, you can start using the API.
On the Lens.org support, there are two very important documents: Requests, and Reponse.
We will explore simple requests, and how to process the response.
The notebook can be used on Visual Studio Code or JupiterLab.
- Clone the GitHub repository: https://github.com/kaust-library/using_lens_org
- Create your virtual environment:
python -m venv venv
. - Activate your environment:
. .\venv\Scripts\activate
. (Windows platform) or. venv/bin/activate
(Linux) - Install the required packages:
pip install -r requirements.txt
.
VScode has support for Jupyter notebook out-of-box. Just open the repository.
File -> open folder -> Folder where you cloned the repository
After following the prerequisites above, you should be able to start jupyter-lab
:
(venv) PS C:\Users\garcm0b\Work\lens_org> jupyter-lab
Jupyter-lab will try to open a new tab/window of the browser, and for me, always failes. The solution is to click on the link below:
(venv) PS C:\Users\garcm0b\Work\lens_org> jupyter-lab
(...)
To access the server, open this file in a browser:
file:///C:/Users/garcm0b/AppData/Roaming/jupyter/runtime/jpserver-26340-open.html <---- Always fails
Or copy and paste one of these URLs:
http://localhost:8888/lab?token=258f8e8f9823683004ee32ce3d33e44673b92e714e6e3615 <---- Always works