Lab Management System (labman)
An opinionated lab management system for academic labs, now available as a CLI tool.
Directory Structure
labman/: Main package directorylib/: Backend modulestemplates/: HTML templatesstatic/: Static assetsserver.py: Flask applicationcli.py: CLI entry point
Installation
Prerequisites
- Python 3.10+
uv(recommended) orpip
Install from pip
pip install ra-labman
Install from source
git clone https://github.com/lokeshmohanty/labman.git
cd labman
uv pip install -e .
Usage
1. Initialize Configuration
Run this command to create the .env configuration file interactively:
labman init
This will ask for:
- Lab Name
- Network Config (
HOST_IP,SERVER_PORT,ALLOWED_HOSTS) - SMTP settings
2. Start the Server
Development mode (default):
labman serve
# OR
labman serve dev
Starts Flask development server.
Production mode:
labman serve prod
# OR
labman serve prod --host 0.0.0.0 --port 9000
- Starts
gunicornin daemon mode (background). - Logs output to
logs/YYYY-MM-DD.log.
Check Status:
labman status
- Shows if the server is running (PID) and the latest log entry.
Stop Production Server:
labman serve stop
- Stops the running gunicorn process (using
gunicorn.pidor matching process name).
3. Management Commands
View Logs:
labman log
Shows the latest log file and follows it (tail -f).
Backup Database:
labman backup
# OR
labman backup now
Creates a copy of the database in backup/YYYY-MM-DD.db.
Automated Backup:
labman backup auto daily
# Options: daily, weekly, monthly
Sets up a cron job to backup the database automatically.
Stop Automated Backup:
labman backup stop
Removes the automated backup cron job.
4. Access the Application
Open your browser at http://<HOST_IP>:<SERVER_PORT> (default: http://localhost:9000).
Default Login (first run):
- Email: Checks
.envSMTP_USERNAME oradmin@example.com - Password:
admin123(Change immediately!)
Features
- User Management: Admin/User roles, secure auth with email activation.
- Research Groups: Hierarchical organization with member management.
- Meeting Management: Scheduling, RSVP, email notifications.
- Content Library: File sharing with access control and notifications.
- Inventory: Equipment and server tracking.
- Email Notifications: Automatic notifications with retry mechanism and background queue.
- CLI Tools: Built-in server management, logging, and backup.
Email Notification System
The system includes a robust email notification system with:
- Automatic Retry: Failed emails are automatically retried up to 3 times with exponential backoff
- Background Queue: Mass notifications (meetings, content) are sent asynchronously to avoid blocking
- Failure Logging: Failed emails are logged to database for manual review and retry
- Graceful Degradation: Application continues to work even if email server is unavailable
Development
To contribute:
- Install in editable mode:
uv pip install -e . - Run tests:
pytest - Check code quality:
ruff check labman/
Testing
Run included tests and utilities:
# Test Email Configuration
labman test email
# Populate Test Data
labman test data
# Clear Test Data
labman test clear
Troubleshooting
Email Not Sending
-
Check SMTP Configuration:
labman test email
This will test your SMTP settings and show any errors.
-
Verify
.envSettings:SMTP_SERVER: Your SMTP server address (e.g.,smtp.gmail.com)SMTP_PORT: Usually587for TLS or465for SSLSMTP_USERNAME: Your email addressSMTP_PASSWORD: Your email password or app-specific passwordSENDER_EMAIL: Email address to send from (usually same as SMTP_USERNAME)
-
Gmail Users: You may need to:
- Enable "Less secure app access" OR
- Generate an "App Password" if using 2FA
-
Check Failed Emails: Failed emails are logged in the database and can be retried manually by an admin.
Database Issues
If you encounter database errors:
# Backup current database
labman backup now
# Check database integrity
sqlite3 data/your_lab.db "PRAGMA integrity_check;"
Server Won't Start
-
Check if port is already in use:
lsof -i :9000 # Replace 9000 with your port
-
Check logs:
labman log
Metadata
Release files for ra-labMan 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ra_labman-0.2.0.tar.gz | 59.9 kB | Without provenance | Details for ra_labman-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ra_labman-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ra_labman-0.2.0-py3-none-any.whl |
Total release size: 144.6 kB
Release files / ra_labman-0.2.0.tar.gz
| Download URL | ra_labman-0.2.0.tar.gz |
|---|---|
| Size | 59.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86f082907af7b0ca0937f7a6e9727989093e4aed75360330f1f6f0455655318b
|
|
BLAKE2b-256 checksum How to use checksums |
97262ff7d605a2d1b7787f9c6ccebfe8827d607b1ed827ec4d255aacb5f27cab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ra_labman-0.2.0-py3-none-any.whl
| Download URL | ra_labman-0.2.0-py3-none-any.whl |
|---|---|
| Size | 84.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
218d81cb8e85731909a4042097f60809b3ba34349072ea26818e82428eeeccee
|
|
BLAKE2b-256 checksum How to use checksums |
5f62efab18c67b63f82e822287437dfc83049b0eada4a09698af0522b333fd55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for ra-labMan 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.