Skip to main content

WebLab-Deusto library for creating unmanaged laboratories

Project description

weblablib

documentation Version Python versions build status Coverage Status

weblablib is a library for creating WebLab-Deusto remote laboratories.

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, weblablib 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/weblablib/

Installation

Simply use pip:

  pip install weblablib

Simple usage

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

app = Flask(__name__)
app.config.update({
    'SECRET_KEY': 'secret', # MUST CHANGE
    'WEBLAB_USERNAME': 'weblabdeusto',
    '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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weblablib-0.5.7.tar.gz (35.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

weblablib-0.5.7-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

weblablib-0.5.7-py2-none-any.whl (39.5 kB view details)

Uploaded Python 2

File details

Details for the file weblablib-0.5.7.tar.gz.

File metadata

  • Download URL: weblablib-0.5.7.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.6

File hashes

Hashes for weblablib-0.5.7.tar.gz
Algorithm Hash digest
SHA256 d70426e4770a439905c3807e197e975d15a63db0e4aa667ee0a1905713758259
MD5 b46ff378978257c0ac8c99a72d877e15
BLAKE2b-256 4a983647000415fc2d9936e2bfde95c273eb32d8708128c776c7d08c68424824

See more details on using hashes here.

File details

Details for the file weblablib-0.5.7-py3-none-any.whl.

File metadata

  • Download URL: weblablib-0.5.7-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.6

File hashes

Hashes for weblablib-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f6b5b87267915e373138187e6e7284210cdea192a59351b7bdcd3bb5cd584b73
MD5 04820eaae58565733f3668059d64ffd3
BLAKE2b-256 ceb9531322f1269df9df26a450605096e07833ff8a4c106d31b33278ae31ced5

See more details on using hashes here.

File details

Details for the file weblablib-0.5.7-py2-none-any.whl.

File metadata

  • Download URL: weblablib-0.5.7-py2-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.6

File hashes

Hashes for weblablib-0.5.7-py2-none-any.whl
Algorithm Hash digest
SHA256 5346f06bbbd0d15a9747ac198e6636e7e5cf31464bc48a00ca2127ec56e73c3e
MD5 a0c8c46f94a2375e4a58327a5a432e9a
BLAKE2b-256 f8ba1e0ed934c8974477051199b42b1f199617f44398859642781010c3cf5590

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page