Skip to main content

labdiscoverylib

CircleCI documentation Version Python versions

labdiscoverylib is a library for creating LabDiscoveryEngine remote laboratories, based on weblablib.

A remote laboratory is a software and hardware system that enables students to access real laboratories through the Internet. For example, a student can be learning how to program a robot by writing code in a computer at home and sending it to a remote laboratory, where the student can see how the program behaves in a real environment.

Creating a remote laboratory may imply many layers, such as authentication, authorization, scheduling, etc., so Remote Laboratory Management Systems (RLMS) were created to make the common layers of remote laboatories. WebLab-Deusto is an Open Source RLMS, and it has multiple ways (see the docs) to create a remote laboratory (in different programming languages, etc.).

In the case of Python, with the popular Flask microframework, labdiscoverylib is the wrapper used to create unmanaged labs. Unmanaged labs is a term used in WebLab-Deusto to refer laboratories where the authors develop the full stack (server, client, deployment), as opposed to managed labs.

If you are familiar with Flask and with Web development, and want to be able to customize everything but not need to implement all the layers of authentication, administration, etc., this library would be very useful. Furthermore, this library allows you to develop remote laboratories for many environments (from regular computers with Linux to systems such as Raspberry Pi). And it integrates very well with other Flask components such as Flask-SocketIO, Flask-SQLAlchemy for databases or Flask-Assets.

Documentation

Read the documentation: https://developers.labsland.com/labdiscoverylib/

Installation

Simply use pip:

  pip install labdiscoverylib

Simple usage

from flask import Flask, url_for
from labdiscoverylib import WebLab, weblab_user, requires_active

app = Flask(__name__)
app.config.update({
    'SECRET_KEY': 'secret', # MUST CHANGE
    'WEBLAB_USERNAME': 'lde',
    'WEBLAB_PASSWORD': 'password',
})

weblab = WebLab(app)

@weblab.on_start
def on_start(client_data, server_data):
    # ...
    print("Starting user")

@weblab.on_dispose
def on_dispose():
    # ...
    print("Ending user")

@weblab.initial_url
def initial_url():
    return url_for('index')

@app.route('/')
@requires_active
def index():
    return "Hello, {}".format(weblab_user.username)

if __name__ == '__main__':
    app.run(debug=True)

Advance examples

You may find here the following examples:

  • simple: basic usage, all in one file.
  • advanced: more advanced usage, with separation of files, tasks, more complex session management
  • complete: based on advanced, but using WebSockets with Flask-SocketIO, internationalization with Flask-Babel and minimified static files with Flask-Assets.

There is another example called quickstart, which is the one used in the documentation, which is something in between simple and advanced.

Metadata

Release files for labdiscoverylib 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for labdiscoverylib 0.6.0
File Size Uploaded
labdiscoverylib-0.6.0.tar.gz 48.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for labdiscoverylib 0.6.0
File Interpreter ABI Platform
labdiscoverylib-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 100.1 kB

Release files / labdiscoverylib-0.6.0.tar.gz

Download URL labdiscoverylib-0.6.0.tar.gz
Size 48.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0c45d65211959e92463213c373d6fbc4400b601ac72ae169393b3fcb5dbe13f4
BLAKE2b-256 checksum
How to use checksums
870693c1b6a71eb427d570b7997a17b096a3014bee48eae935976083fa5ff784
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release files / labdiscoverylib-0.6.0-py3-none-any.whl

Download URL labdiscoverylib-0.6.0-py3-none-any.whl
Size 51.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d89651c9eb9bbe576aa42abc9e0fda7575c26539a521711bc25f02597fc1830
BLAKE2b-256 checksum
How to use checksums
8e59a4b565c3899670ab4e928ebbd2dbe47586b2f343bbe865a5513509b3f7cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page