Dependencies and Packages

QGas is built on a combination of Python backend tools and JavaScript frontend libraries. This document provides a comprehensive overview of all dependencies, their purposes, and version requirements.

Python Dependencies

The Python environment is managed via Conda and defined in environment.yml.

Core Python

Package Version Purpose
python 3.11.5+ Base Python interpreter. Version 3.11 required for modern features and performance.

GUI and Image Processing

Package Version Purpose
tkinter Built-in Desktop GUI framework. Included with Python, used for server control interface.
Pillow 10.0.0+ Python Imaging Library. Used for logo display in GUI and image processing for georeferencing.

HTTP Communication

Package Version Purpose
http.server Built-in Standard library HTTP server for serving static files and JSON endpoints.
socketserver Built-in TCP server infrastructure with address reuse for quick restarts.

Utilities

Package Version Purpose
json Built-in JSON parsing and serialization for GeoJSON data handling.
gzip Built-in Data compression for efficient transfer of large GeoJSON files.
threading Built-in Server execution in background threads.
concurrent.futures Built-in Thread pool executor for parallel processing of data operations.

JavaScript Dependencies (Frontend)

JavaScript libraries are loaded via CDN in the browser. No local installation required.

Mapping and Visualization

Library Version Purpose Source
Leaflet.js 1.9.4 Core interactive mapping library. Provides map rendering, layer management, and interaction handling. unpkg.com
Leaflet Draw 1.0.4 Drawing tools plugin for Leaflet. Enables interactive geometry creation and editing. cdn.jsdelivr.net
Leaflet PolylineDecorator 1.6.0 Arrow decorators for pipelines. Shows flow direction on pipeline segments. cdn.jsdelivr.net
OpenStreetMap Tiles Current Background map tiles. Requires internet connection during use. openstreetmap.org

Data Processing

Library Version Purpose Source
JSZip 3.10.1 ZIP file creation in browser. Used for packaging exports. cdnjs.cloudflare.com
SheetJS (xlsx) 0.18.5 Excel file handling. Enables Excel export functionality. cdnjs.cloudflare.com

Charting and Statistics

Library Version Purpose Source
Chart.js Latest Interactive charts for statistics window. Renders bar charts, pie charts, histograms. cdn.jsdelivr.net
chartjs-plugin-zoom Latest Chart.js plugin for zooming and panning in statistical charts. cdn.jsdelivr.net

Development Tools (Optional)

These tools are recommended for development but not required for running QGas:

Tool Purpose
VS Code Recommended IDE with Python and JavaScript support
Python Extension VS Code Python language support and debugging
Git Version control

Browser Requirements

QGas requires a modern web browser with ES6+ JavaScript support:

Recommended Browsers

Required Browser Features

Network Ports

QGas requires the following ports to be available:

Port Protocol Purpose
8000 HTTP Static file server and API endpoints

Ensure these ports are not blocked by firewall or used by other applications.

Installation via Conda

All Python dependencies are automatically installed when creating the Conda environment:

conda env create -f environment.yml
conda activate QGas

This ensures:

Dependency Management

Adding New Python Dependencies

To add a new Python package:

  1. Add it to environment.yml under dependencies
  2. Update the environment: conda env update -f environment.yml
  3. Document it in this file

Adding New JavaScript Libraries

To add a new JavaScript library:

  1. Add CDN link in GUI.html header
  2. Ensure it's loaded before scripts that use it
  3. Document it in this file
  4. Consider fallback for offline scenarios if critical

Version Pinning Strategy

Note on Updates
Before updating major versions of Leaflet or other core libraries, thoroughly test all functionality as API changes may break existing tools.