A package containing handy boilerplate utilities for developing bfabric web-applications
Project description
B-Fabric Web Apps
A Python-based library designed for the development and integration of satellite applications with the B-Fabric Laboratory Information Management System (LIMS).
Explore the documentation »
View Demo
Table of Contents
- About The Project
- Quickstart
- What Is B-Fabric?
- What Is B-FabricPy?
- What Is Dash?
- Roadmap
- Contributing
- License
- Contact
- Acknowledgments
About The Project
The bfabric_web_apps is a Python library designed to simplify the creation of web applications that interact with B-Fabric. The library streamlines the development of B-Fabric satellite applications by standardizing common patterns and providing developers with a simpler and more efficient code base. B-Fabric Web Apps are modular satellite applications that extend the functionality of the B-Fabric Laboratory Information Management System (LIMS).
Key Features
- Token Management – Securely handle authentication tokens for API access.
- Entity Data Handling – Retrieve, modify, and update B-Fabric entities dynamically.
- Logger – Integrated logging for API calls, events, and errors.
- Layouts and UI Components – Utilize predefined structures to streamline app design.
Built With
Quickstart
You can install the bfabric_web_apps module via pip:
pip install bfabric_web_apps
Basic Usage Example
After installation, you can create a simple Dash-based web application using bfabric_web_apps like this:
# Import necessary modules
from dash import html
from bfabric_web_apps import(
create_app,
get_static_layout,
HOST,
PORT,
)
# Initialize the Dash application
app = create_app()
# Define application title
app_title = "My B-Fabric App"
# Define the main layout content
app_specific_layout = html.Div([
html.H1("Welcome to My B-Fabric App"),
html.P("This is a quickstart example using bfabric_web_apps.")
])
# Optionally define documentation content
documentation_content = [
html.H2("Documentation"),
html.P("Describe your app's features here.")
]
# Set up the application layout
app.layout = get_static_layout(
app_title, # Title shown in the browser tab
app_specific_layout, # Main application content
documentation_content # Documentation section
)
# Run the application
if __name__ == "__main__":
app.run(debug=False, port=PORT, host=HOST)
This example sets up a minimal web application using bfabric_web_apps, providing a structured layout with configurable content.
Running Your Application
After creating your Dash app, you have several options to run it:
Development Mode (Flask Dev Server)
For development with auto-reload:
python your_app.py
Or using the CLI tool:
bfabric-webapp your_app:app.server --dev
Production Mode (Gunicorn)
For production deployments, the library includes Gunicorn as a dependency and provides a gunicorn.conf.py configuration file that automatically reads settings from your .env file (HOST, PORT, etc.).
Using the CLI tool (recommended):
bfabric-webapp your_app:app.server
The CLI automatically detects your environment:
- If
DEBUG=Truein.env: Uses Flask dev server - If
DEBUG=Falsein.env: Uses Gunicorn for production - Use
--devflag to force development mode - Use
--prodflag to force production mode
Using Gunicorn directly:
gunicorn 'your_app:app.server' -c gunicorn.conf.py
Or with uv:
uv run gunicorn 'your_app:app.server' -c gunicorn.conf.py
The gunicorn configuration automatically uses your .env settings for HOST, PORT, and other server options.
URL Path Prefix: To run the app under a subpath (e.g., /myapp/), set SCRIPT_NAME=/myapp in your .env file.
Example Usage and Template Overview
To explore the usage of the bfabric_web_apps library in greater detail, refer to the bfabric-web-app-template repository. This template demonstrates how to:
- Set up a project using
bfabric_web_apps. - Create visual dashboards with Dash.
- Interact with the B-Fabric LIMS through the Python library.
What Is B-Fabric?
B-Fabric is a Laboratory Information Management System (LIMS) used for managing scientific experiments and their associated data in laboratories. It provides a platform for tracking samples, analyzing results, and organizing workflows efficiently.
For more details, visit the B-Fabric official website.
What Is BfabricPy?
BfabricPy is a Python library that provides a programmatic interface to interact with the Bfabric SOAP WebService. It allows developers to integrate B-Fabric functionalities into custom Python applications. This library simplifies tasks like querying samples, uploading results, and interacting with the LIMS programmatically.
BfabricPy is a dependency of this project and is fetched directly from its GitHub repository during installation.
For more details, visit the bfabricPy official Git repository or the library's official documentation.
What Is Dash?
Dash is a Python framework for building interactive web applications. It combines the power of Plotly for data visualization and Flask for backend support, making it ideal for scientific and analytical dashboards.
For more details, visit the Dash official documentation.
Roadmap
Contact the development team for planned features and known issues.
Contributing
bfabric_web_apps is an open-source project, and therefore any contributions you make are greatly appreciated. If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature
- Make your changes and commit them:
git commit -m "Add feature: YourFeature"
- Push to your branch:
git push origin feature/YourFeature
- Open a Pull Request.
Top contributors:
Contact the development team for contributor information.
License
Distributed under the MIT License. See LICENSE file for more details.
Contact
GWC GmbH - LinkedIn Griffin White - LinkedIn Marc Zuber - LinkedIn
Acknowledgments
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bfabric_web_apps-0.5.0.tar.gz.
File metadata
- Download URL: bfabric_web_apps-0.5.0.tar.gz
- Upload date:
- Size: 43.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.14.0-1019-oem
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5541c534133ec7b53e9e08af98dedd63b35ea900515a1b0657a3baf200af58d
|
|
| MD5 |
1c0601d0b4046e8ec8222ea45e388dbd
|
|
| BLAKE2b-256 |
ce391d0ba0753a5a700e0578efe9f4c3bec38a67db9c06b99dd6fc8884bb6ebb
|
File details
Details for the file bfabric_web_apps-0.5.0-py3-none-any.whl.
File metadata
- Download URL: bfabric_web_apps-0.5.0-py3-none-any.whl
- Upload date:
- Size: 49.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.14.0-1019-oem
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07eab9714f3ba777ca49db410c33ad2747745ccd3969f404849b049963ff74b1
|
|
| MD5 |
881fe0bbc5fcdec4a31169eae7c41064
|
|
| BLAKE2b-256 |
27bb7956242e32c3fd8727fa84de128a90515adcdc85ecaaba8512b1a2f857b8
|