A comprehensive Python package for environmental sensing data tools, gridded climate data access, IoT device management, and data visualization.
Built and maintained by the RTGS Lab, please email radli009@umn.edu for database access and any questions or issues. Also feel free to open issues on GitHub.
RTGS Lab Tools consolidates multiple environmental data analysis workflows into a unified toolkit with both command-line and natural language interfaces. The package provides tools for extracting sensor data from the GEMS database, downloading climate reanalysis data, visualizing time series, managing IoT devices, and parsing data packets.
Before installing RTGS Lab Tools, ensure you have the following software installed:
Installation:
- Download: Python.org Downloads - Get the latest Python 3.10+ version
- Verify installation: Open a terminal and run:
You should see Python 3.10 or higher.
python --version # or python3 --version
Installation:
- Windows: Download Git for Windows -Important: Use Git Bash (included with Git for Windows) instead of PowerShell or Command Prompt for all commands
- macOS:
- Install via Homebrew:
brew install git - Or download from Git website
- Install via Homebrew:
- Linux: Install via package manager:
# Ubuntu/Debian: sudo apt update && sudo apt install git # CentOS/RHEL/Fedora: sudo yum install git # or sudo dnf install git
- Verify installation:
git --version
Installation:
- Usually included with Python 3.10+ installations
- If missing: Download get-pip.py and run:
python get-pip.py
- Verify installation:
pip --version # or pip3 --version
Installation Please follow instructions for your operating system: gcloud install instructions
- PostgreSQL client libraries (for GEMS database access)
- UMN VPN connection (for database access)
Always use Git Bash instead of PowerShell or Command Prompt when running installation commands. Git Bash provides a Unix-like environment that ensures compatibility with the installation scripts.
Use the automated installation script for cross-platform setup:
git clone https://github.com/RTGS-Lab/rtgs-lab-tools.git
cd rtgs-lab-tools
bash install.shThe install script will:
- Detect your operating system (Windows/macOS/Linux)
- Verify Python 3.10+ installation
- Install
uvpackage manager if needed - Initialize git submodules
- Create and activate a virtual environment
- Install the package in development mode
- Set up credential templates
- Configure MCP servers for Claude Desktop integration
For existing installations: The script automatically detects existing setups and performs updates instead of fresh installations.
To update your existing RTGS Lab Tools installation:
# Navigate to your rtgs-lab-tools directory
cd rtgs-lab-tools
# Run the install script (it will automatically detect and update)
bash install.shThe update process will:
- Check for uncommitted local changes (must be clean to update)
- Fetch the latest release from GitHub
- Update to the latest stable version
- Reinstall dependencies
- Reconfigure MCP servers
Alternative update method (post v0.1.0):
# Using the built-in update command
rtgs core updateAfter running the installation script, follow these steps to complete your setup:
# Linux/macOS:
source venv/bin/activate
# Windows (Git Bash/WSL):
source venv/Scripts/activateOption 1: Google Cloud Authentication (Recommended for Lab Users)
For lab users with Google Cloud access, authenticate with Google Cloud for automatic credential management:
rtgs auth loginThis will:
- Open your browser for Google Cloud authentication
- Set up Application Default Credentials
- Enable automatic retrieval of database credentials from Google Secret Manager
Check your authentication status:
rtgs auth statusOption 2: Environment Variables (For External Users)
If you don't have Google Cloud access, edit the .env file with your credentials:
nano .env # or use your preferred editorRequired Environment Variables:
GEMS Database (required for sensor data):
DB_HOST,DB_PORT,DB_NAME,DB_USER,DB_PASSWORD
Logging Database (optional for audit features):
LOGGING_DB_HOST,LOGGING_DB_PORT,LOGGING_DB_NAMELOGGING_DB_USER,LOGGING_DB_PASSWORDLOGGING_INSTANCE_CONNECTION_NAME(GCP Cloud SQL)POSTGRES_LOGGING_STATUS(True/False)
Google Earth Engine (optional for satellite data):
GEE_PROJECT(Google Cloud project name)BUCKET_NAME(Google Cloud Storage bucket)
PlanetLabs (optional for high-res satellite imagery):
PL_API_KEY(PlanetLabs API key)
Device Management (optional for IoT devices):
PARTICLE_ACCESS_TOKEN(usertgs auth particle-loginto create)
rtgs --helprtgs sensing-data list-projectsBefore running the installation script on MSI infrastructure, load the required modules:
module load python
module load git
# Then proceed with installation
git clone https://github.com/RTGS-Lab/rtgs-lab-tools.git
cd rtgs-lab-tools
bash install.shgit clone https://github.com/RTGS-Lab/rtgs-lab-tools.git
cd rtgs-lab-tools
uv venv venv
source venv/bin/activate
# Install with uv (works on all systems):
uv pip install -e ".[all]"# Check current version
rtgs core version
# Check for updates
rtgs core update
# Login
rtgs auth login
# for MSI
rtgs auth login --headlessrtgs sensing-data list-projectsrtgs sensing-data extract --project "Winter Turf - v3" --start-date 2023-01-01 --end-date 2023-01-31rtgs data-parser parse data/Winter_Turf_v3_2023-01-01_to_2023-01-31.csvrtgs visualization create --file data/parsed/Winter_Turf_v3_2023-01-01_to_2023-01-31_20240407153045_parsed.csv --parameter "Kestrel.PORT_V[0]" --node-id "e00fce68c148e3450a925509"rtgs gridded-data get-gee-point --source MOD --variables "sur_refl_b01,sur_refl_b02" --start-date 2023-01-01 --end-date 2023-01-31The package is organized into specialized modules, each with its own detailed documentation:
- Sensing Data - Extract and manage environmental sensor data from the GEMS database
- Visualization - Create time-series plots and multi-parameter visualizations
- Gridded Data - Download and process climate data from Google Earth Engine
- Data Parser - Parse and process raw sensor data files
- Device Configuration - Manage IoT device configurations and settings
- Agricultural Modeling - Crop calculations, unit conversions, and agricultural modeling
- Audit - Track and analyze tool usage and generate reports
- Authentication - Google Cloud authentication for secure credential management
Get help for any module:
rtgs <module-name> --helpList all available commands:
rtgs --help# Version and update management
rtgs core version # Show current version information
rtgs core update # Update to latest release
# Authentication management
rtgs auth login # Authenticate with Google Cloud
rtgs auth logout # Logout from Google Cloud
rtgs auth status # Check authentication status
rtgs auth particle-login # Create Particle Cloud access tokenThe package includes a FastMCP server that enables natural language interaction with all tools through Claude or other LLM clients. For detailed setup instructions, see the MCP Server documentation.
- Install as normal with
bash install.sh - Start Claude Code with
claudein the repository directory - The included
.mcp.jsonconfiguration will be automatically recognized
- Install as normal with
bash install.sh - Start Gemini CLI with
geminiin the repository directory - The included
.gemini/settings.json(same file as .mcp.json) configuration will be automatically recognized
See the MCP Server documentation for Claude Desktop configuration details.
The package requires a .env file for database and API access. The installation script creates a template that you can edit with your credentials.
- UMN VPN: Required for GEMS database access
- Database Credentials: Contact Bryan Runck (runck014@umn.edu) for access
Primary Method - Google Cloud Authentication:
- Lab users should use
rtgs auth loginfor automatic credential management - Credentials are securely retrieved from Google Cloud Secret Manager
- No need to manage
.envfiles for database credentials
Fallback Method - Environment Variables:
- External users or those without Google Cloud access use
.envfiles - Manual credential management required
- Automatically used when Google Cloud authentication is unavailable
The system automatically tries credentials in this order:
- Google Cloud Secret Manager (if authenticated with
rtgs auth login) - Environment Variables (from
.envfile or system environment) - Error (if neither method provides required credentials)
This allows lab users to use managed secrets while external users can use local environment variables seamlessly.
- Google Earth Engine: For satellite data access
- Particle Cloud API: For IoT device management
For detailed configuration instructions, see individual module documentation.
uv run pytestuv run black src/ tests/
uv run isort src/ tests/We welcome contributions! For detailed guidelines, see CONTRIBUTING.md.
- Fork and clone the repository
- Run
bash install.shto set up your development environment - Make your changes with appropriate tests
- Run
uv run pytestand formatting checks - Submit a pull request with a clear description
- Module Documentation - Detailed guides for each tool module
- Contributing Guidelines - Development workflow and standards
- MCP Server Setup - Natural language interface configuration
- RTGS Lab: https://rtgs.umn.edu/
- Repository: https://github.com/RTGS-Lab/rtgs-lab-tools
- Issues: Use GitHub issue tracker
- Database Access: Bryan Runck (runck014@umn.edu)
This project is licensed under the MIT License - see the LICENSE file for details.
For detailed API documentation and advanced usage, see the module-specific README files in the src/rtgs_lab_tools/ directory.