A python wrapper for interacting with the LabArchives API.

Overview

LabArchives API wrapper for Python

A python wrapper for interacting with the LabArchives API. This very simple package makes it easier to make arbitrary calls to the LabArchives REST API using python's requests module.

Installation

Please ensure you have Python 3.3+ installed. Then run:

git clone https://github.com/mcmero/labarchives-py
cd labarchives-py
pip install .

Configuration

You will now have to make a config.yaml file with the following information:

api_url: <base URL for the API>
access_key_id: <your LabArchives access key ID>
access_password: <your LabArchives password>

https://api.labarchives.com/api is the normal base URL for the LabArchives API, however this may vary by region (for Australia, use https://auapi.labarchives.com/api).

Testing

Once you've done this, you can now test the install by running:

pytest

Using the API

The tests/test_client.py file will give you a good example on how to use the package. A minimal example would look something like:

# import Client from the package
from labarchivespy.client import Client

# load your config file
with open('config.yaml', 'r') as stream:
    config = yaml.safe_load(stream)

# set up client
api_url = config['api_url']
access_key_id = config['access_key_id']
access_password = config['access_password']
client = Client(api_url, access_key_id, access_password)

response = client.make_call('utilities', 'institutional_login_urls')
assert response.ok

You can now parse the response object for the desired information, or check the corroesponding notebook entry if you've made a call that makes some kind of change to your ELN. Note that you will have to look up the API class and method call name from the LabArchives REST API. The documentation shows example URLs in the following format:

https://<baseurl>/api/<api_class>/<api_method>?<Call Authentication Parameters>

You'll need to use the correct api_class and api_method when using the make_call function, and ensure your parameters are correct.

Most calls that do anything useful require a user ID. This will require you to obtain your app authentication token (if you are using SSO). To get this, login to your LabArchives and click on your name (top right) then "LA App authentication". Copy this password. You can now get your user ID:

import xml

login_params = {'login_or_email': <your_username>, 'password': <your password token>}
response = client.make_call('users', 'user_access_info', params=login_params)
uid = xml.etree.ElementTree.fromstring(response.content)[0].text

print(uid)

You can now use this in calls, for example:

params = {'uid': uid}
response = client.make_call('users', 'user_info_via_id', params=params)
Owner
Marek Cmero
Senior Research Officer, Sequencing Bioinformatics
Marek Cmero
Stinky ID - A stable pluggable Telegram userbot + Voice & Video Call music bot, based on Telethon

Ultroid - UserBot A stable pluggable Telegram userbot + Voice & Video Call music

Riyan.rz 1 Jan 03, 2022
Generate visualizations of GitHub user and repository statistics using GitHubActions

GitHub Stats Visualization Generate visualizations of GitHub user and repository

Jun Shi 3 Dec 15, 2022
this repo store a Awoesome telegram bot for protect from your large group from bot attack.

this repo store a Awoesome telegram bot for protect from your large group from bot attack.

Mehran Alam Beigi 2 Jul 22, 2022
A Video Streaming Telegram Bot written in Python with Pyrogram and PyTgcalls

Video Stream Bot A Video Streaming Telegram Bot written in Python using Pyrogram and PyTgcalls Requirements Python 3.9 Telegram API Telegram Bot Token

Aarav Arora 61 Dec 10, 2022
Python wrapper for the Sportradar APIs ⚽️🏈

Sportradar APIs This is a Python wrapper for the sports APIs provided by Sportradar. You'll need to sign up for an API key to use the service. Sportra

John W. Miller 39 Jan 01, 2023
This is a discord bot, which tells you food recipes.

Discord Chef Bot You have a friend, familiy or other group / channel where the topic is the food? You cannot really decide what's for Saturday lunch?

2 Apr 25, 2022
Azure Neural Speech Service TTS

Written in Python using the Azure Speech SDK. App.py provides an easy way to create an Text-To-Speech request to Azure Speech and download the wav file. Azure Neural Voices Text-To-Speech enables flu

Rodney 4 Dec 14, 2022
Simple integrate of API udemy.com with python

Pyudemy Simple integrate of API udemy.com with python Quick start $ pip install pyudemy or $ python setup.py install Authentication To make any calls

Hudson Brendon 30 Jan 02, 2023
Kevin L. 3 Jul 14, 2022
Senditapp.com bot spammer, spam your friends

Sendit Spammer Python ⚠️ I am not responsible for how you use this tool. This tool is against "Sendit" ToS and shall not be used in a production envir

Glaukio 1 Dec 31, 2021
An API or getting Optifine VersionsList/Version/Download-URL.

Optifine-API An API for getting Optifine VersionsList/Versions/Download-URL. Table of contents Get Versions List Get Specify Versions Download Optifin

2 Dec 04, 2022
Robocord is a bot created for the Pycord community.

Robocord is a bot created for the community of the Pycord Server. Just a bot created for Pycord Server. You can start pull requests, I will check it and if its good I will add it to the bot. 👍

Bruce 7 Jun 26, 2022
Group Management Bot

❤️ 𝗦𝗛𝗔𝗗𝗜𝗬𝗢 ❤️ A Powerful, Smart And Advance Group Manager ... Written with AioGram , Pyrogram and Telethon... ⭐️ Thanks to everyone who starred

Abdisamad Omar Mohamed 4 Dec 01, 2021
Discord bot written in python

Discord bot created by dpshark#3004 for fun List of features/commands: [keyword] responses tools !add [respons] Adds new response to [keyword] !remove

Daniel K.Gunleiksrud 3 Dec 28, 2021
Petit webhook manager by moi (wassim)

Webhook Manager By wassim oubliez pas de ⭐ le projet Installations il te faut python sinon quand tu va lancer le start.bat sa va tout installer tout s

wassim 9 Jul 08, 2021
Maubot azuracast - A maubot to fetch data from your radio station

Maubot Azuracast A maubot to fetch data from your radio station Setup Configure

3 Mar 14, 2022
Python package for Calendly API v2

PyCalendly Python package to use Calendly API-v2. Installation Install with pip $ pip install PyCalendly Usage Getting Started See Getting Started wi

Lakshmanan Meiyappan 20 Dec 05, 2022
A discord account nuker with lots of tools that will destroy a discord account

A discord account nuker with lots of tools that will destroy a discord account (token destroyer... and much more).

firexi 10 Apr 28, 2022
Access LeetCode problems via id

LCid - access LeetCode problems via id Introduction As a world's leading online programming learning platform, LeetCode is quite popular among program

bunnyxt 14 Oct 08, 2022
Replace sequence_IDs in gff3 based on given genome.fasta

gff-rename Replace the sequence IDs in a gff3 file with a set of provided sequence IDs from a genom.fasta. This is useful when a gff3 file is retrieve

tolkit 1 Nov 12, 2021