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
PepeSniper is an open-source Discord Nitro auto claimer/redeemer made in python.

PepeSniper is an open-source Discord Nitro auto claimer made in python. It sure as hell is not the fastest sniper out there but it gets the job done in a timely and stable manner. It also supports ho

Unknown User 1 Dec 22, 2021
A Discord bot coded in Python

Perseverance-Bot By Toricane Replit Code | GitHub Code | Discord Server | Website Perseverance is a multi-purpose bot coded in Python. It has moderati

4 Mar 30, 2022
A wordwolf bot with python

ワードウルフBot requirements.txtから依存ライブラリをインストールしてください discordのトークン/Google spread sheetのキー/Sheetの名前を.envに書き込んでください DISCORD_TOKEN SHEET_KEY SHEET_NAME また、.sh

Kato 2 Dec 11, 2022
A basic Ubisoft API wrapper created in python.

UbisoftAPI A basic Ubisoft API wrapper created in python. I will be updating this with more endpoints as time goes on. Please note that this is my fir

Ethan 2 Oct 31, 2021
Discord Webhook Spammer (fastest)

Discord Webhook Spammer A simple fast asynchronous webhook spammer. Spammer Features Fast message spamming. Controllable speed. Noob friendly. Usage N

Varient 2 Apr 22, 2022
AWS DeepRacer Free Student Workshop: Run faster by using your custom waypoints

AWS DeepRacer Free Student Workshop: Run faster by using your custom waypoints Reward Function Template for waypoints def reward_function(params):

Yuen Cheuk Lam 88 Nov 27, 2022
Projeto com o objetivo de aprender o funcionamento de Consumo de APIs.

Consumindo API SuperHero Projeto com o objetivo de aprender o funcionamento de Consumo de APIs.

Deivisson Henrique 1 Dec 30, 2021
A simple tool which automate commands of discord economy bots

A simple tool which automate commands of discord economy bots. Fully configurable using an intuitive configuration made in YAML

SkydenFly 5 Sep 18, 2022
Script to get a notification when a product, on Amazon Warehouse, is available within a target price

Amazon_Warehouse_Scraping This script aims to scrape Amazon Warehouse and send an email back if there are products whose price matches with the target

2 Oct 25, 2021
WikiChecker - Repositorio oficial del complemento WikiChecker para NVDA.

WikiChecker Buscador rápido de artículos en Wikipedia. Introducción. El complemento WikiChecker para NVDA permite a los usuarios consultar de forma rá

2 Jan 10, 2022
Multipurpose Discord bot hosted on replit.com

RockyBot Multipurpose Discord bot hosted on https://replit.com/ Installing Dependencies Install poetry through pip: pip install poetry Then simply exe

Rocky 2 May 18, 2022
This Bot Can Upload Video from Link Of Pdisk to Pdisk using its API. @PredatorHackerzZ

𝐏𝐝𝐢𝐬𝐤 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫 𝐁𝐨𝐭 Make short link by using 𝐏𝐝𝐢𝐬𝐤 API key Installation 𝐓𝐡𝐞 𝐄𝐚𝐬𝐲 𝐖𝐚𝐲 𝐑𝐞𝐪𝐮𝐢𝐫𝐞𝐝 𝐕𝐚𝐫𝐢𝐚𝐛𝐥𝐞

ρяє∂αтσя 25 Dec 02, 2022
A full-fledged discord bot with moderation and a lot more.

HOT-BOT-POL-POT ⭐ Star me on GitHub m'lady.... hot-bot-pol-pot is a moderation discord bot written using enhanced-dpy library with many functionalitie

Pure Cheekbones 4 Oct 08, 2022
Github action for automatically determine the version for next release by using repository tags

This action will automatically determine the version for next release by using repository tags

Igor Gov 7 Oct 25, 2022
Messing around with GitHub API to look at omicron build times

gh-workflow-runs This is a very simple tool to dump out basic information about workflow runs for a GitHub repo. The structure is based on gh-subscrip

David Pacheco 1 Nov 30, 2021
A python interface for interacting with the Ethereum blockchain and ecosystem.

Web3.py A Python library for interacting with Ethereum, inspired by web3.js. Python 3.6+ support Quickstart Get started in 5 minutes or take a tour of

3.9k Jan 03, 2023
A Discord bot that automatically saves SHSH blobs for all of your iOS devices.

AutoTSS AutoTSS is a Discord bot that automatically saves SHSH blobs for all of your iOS devices. Want a CLI automatic blob saver? Check out AutoTSS-c

adam 79 Dec 13, 2022
A Telegram Bot for searching any channel messages from Inline by @AbirHasan2005

Message-Search-Bot A Telegram Bot for searching any channel messages from Inline by @AbirHasan2005. I made this for @AHListBot. You can use this for s

Abir Hasan 44 Dec 27, 2022
Instagram bot for promoting ROKA trainee soldier(just like me)'s consolation letters.

Instagram_bot (필자를 포함한) 모든 대한민국 훈련병들을 위한 인스타그램 인편지기입니다. Instagram bot for promoting ROKA trainee soldier(just like me)'s consolation letters. 들어가기 (Ge

Lee, Jongjun 2 Nov 21, 2021