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
Black-hat with python

black-hat_python Advantages - More advance tool Easy to use allows updating tool update - run bash update.sh Here -: Command to install tool main- clo

Hackers Tech 2 Feb 10, 2022
Infinity: a Twitter retweet bot that can be used by anyone

INSTAMATE Requires Firefox Instapy Python3 How To Use? Fork the repository Add your credentials in the bot.py file Save commits Clone your fork cd int

unofficialdxnny 3 Jun 23, 2022
Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single bot.

Discord ToolBox Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single b

3 Aug 07, 2021
A beginner’s guide to train and deploy machine learning pipelines in Python using PyCaret

This model involves Insurance bill prediction, which was subsequently deployed on Heroku PaaS

1 Jan 27, 2022
Python Library for Secp256k1 Bitcoin curve to do fast ECC calculation

secp256k1 Python Library for Secp256k1 Bitcoin curve to do fast ECC calculation Example Usage import secp256k1 as ice print('[C]',privatekey_to_addres

iceland 49 Jan 01, 2023
A Discord bot written in Python that can be used to control event management on a server.

Event Management Discord Bot A Discord bot written in Python that can be used to control event management on a Discord server. Made originally for GDS

Suvaditya Mukherjee 2 Dec 07, 2021
A file-based quote bot written in Python

Let's Write a Python Quote Bot! This repository will get you started with building a quote bot in Python. It's meant to be used along with the Learnin

1 Oct 28, 2021
A simple telegram Bot, Upload Media File| video To telegram using the direct download link. (youtube, Mediafire, google drive, mega drive, etc)

URL-Uploader (Bot) A Bot Upload file|video To Telegram using given Links. Features: 👉 Only Auth Users (AUTH_USERS) Can Use The Bot 👉 Upload YTDL Sup

Hash Minner 18 Dec 17, 2022
Instagram Bot posting earthquakes with magnitude greater than or equal to 3.5.

Instagram Bot posting earthquakes with magnitude greater than or equal to 3.5

Alican YĂĽksel 4 Aug 22, 2022
Pagination for your discord.py bot using the discord_components library!

Paginator - discord_components This repository is just an example code for how to carry out pagination using the discord_components library for python

Skull Crusher 9 Jan 31, 2022
A small bot to interact with the reddit API. Get top viewers and update the sidebar widget.

LiveStream_Reddit_Bot Get top twitch and facebook stream viewers for a game and update the sidebar widget and old reddit sidebar to show your communit

Tristan Wise 1 Nov 21, 2021
Module to use some statistics from Spotify API

statify Module to use some statistics from Spotify API To use it you have to import the functions into your own project. You have also to authenticate

Miguel CĂłzar 2 Jun 02, 2022
A quick-and-dirty script to scrape the daily menu of Leipzig University Mensa and send it to a telegram channel.

Feed me Mensa UL A quick-and-dirty script to scrape the daily menu of Leipzig University Mensa and send it to a telegram channel. For food and cat lov

3 Apr 08, 2022
Python bindings for ArrayFire: A general purpose GPU library.

ArrayFire Python Bindings ArrayFire is a high performance library for parallel computing with an easy-to-use API. It enables users to write scientific

ArrayFire 402 Dec 20, 2022
Its The Basic Commands Of Termux

Its The Basic Commands Of Termux

ANKIT KUMAR 1 Dec 27, 2021
this is a telegram torrent bot

owner of this repo :- AYUSH contact me :- AYUSH Slam Mirror Bot This is a telegram bot writen in python for mirroring files on the internet to our bel

AYUSH 237 Dec 16, 2021
Software com interface gráfica para criar postagens anônimas no Telegra.ph do Telegram e compartilhar onde quiser...

Software com interface gráfica para criar postagens anônimas no Telegra.ph do Telegram e compartilhar onde quiser...

Elizeu Barbosa Abreu 4 Feb 05, 2022
Yet another random discord bot.

YARDB (r!) Yet another fully functional and random discord bot. I might add more features if I'm bored also don't criticize on my code. Commands: 4 Di

kayle 1 Oct 21, 2021
The elegance of Airflow + the power of AWS

Orkestra The elegance of Airflow + the power of AWS

Stephan Fitzpatrick 42 Nov 01, 2022
A python script that changes our background based on current weather and time of the day.

Desktop background on Windows 10, based on current weather and time A python script that changes our background based on current weather and time of t

Maj Gaberšček 1 Nov 16, 2021