CompNumberCheck is a full-stack web application engineered to solve a specific data visibility problem within the British Gliding Association (BGA) and the broader soaring community. A BGA competition number (comp number) is a unique 1, 2, or 3-character alphanumeric identifier visually applied to gliders for tracking during races. By rule, each alphanumeric combination can only be assigned to a single aircraft at any given time. With no centralized online system previously available to verify which numbers are free, this application provides an instant, programmatic lookup tool. It ingests, normalizes, and queries open-source registry data to give pilots definitive confirmation on competition number availability. It should be noted that CompNumberCheck is inherently limited by its data sources, as it only cross-references competition numbers that have been actively registered to the Open Glider Network (OGN) or Flarmnet. Consequently, not all gliders are included in the dataset. However, this limitation is effectively mitigated by the rule that ownership of a competition number expires after up to 5 years. Therefore, if an aircraft is so old or inactive that it has never been registered on OGN or Flarmnet, it is highly likely that its competition number has already expired and returned to the pool of available numbers.
- Backend: Python 3, Flask
- Data Processing: Pandas, Regular Expressions (Regex)
- Frontend: HTML5, CSS3, Vanilla JavaScript (ES6+)
- Architecture: RESTful API, ETL Pipeline
- Automated ETL Data Pipeline:
csvSorter.pyacts as an Extract, Transform, Load (ETL) engine, utilizing Pandas to ingest raw Flarm/OGN datasets, drop null values, and strip out unregistered aircraft (e.g., paragliders, ground stations). - Regex-Powered Format Normalization: Implements robust Regular Expressions to intelligently reconstruct inconsistent aircraft registration data. It parses single and double-letter country codes (ICAO) and injects hyphens dynamically to ensure standard formatting across international registries.
- Decoupled REST API: The Flask backend (
csvSearch.py) serves as a stateless API. It loads the cleaned dataset into memory on startup (via theCheckerclass) for low-latencyO(n)filtering based on JSON POST requests, ensuring fast and reliable query resolution. - Asynchronous Frontend Integration: A clean, responsive UI that leverages Vanilla JavaScript and the native Fetch API to communicate with the backend endpoint (
/check). It includes client-side validation and dynamically updates the DOM without requiring a page reload.
To run this project locally, ensure you have Python 3 installed. Follow these steps:
# 1. Clone the repository
git clone https://github.com/yourusername/CompNumberCheck.git
cd CompNumberCheck
# 2. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
# 3. Install project dependencies
pip install -r requirements.txt
# 4. Run the ETL script to generate the cleaned dataset (OGN.csv)
# (Ensure 'convertcsv.csv' is in the root directory before running)
python csvSorter.py
# 5. Start the Flask application server
python csvSearch.pycsvSorter.py: The data processing engine. It reads raw registry data, cleanses invalid entries, applies regex-based normalizations to international aircraft registrations, derives country origins from prefixes, and exports the production-readyOGN.csv.csvSearch.py: The core application server. Instantiates the Flask web application, manages theCriteria_Classdata models, and exposes the POST/checkendpoint. It parses incoming JSON requests and executes Pandas dataframe filtering to return availability status.index.html: The presentation layer. Contains a responsive form with a built-in datalist for country filtering.main.js: The client-side logic. Handles asynchronous API calls to the Flask backend, input validation (e.g., enforcing the 3-character maximum), and error handling.requirements.txt: Explicitly tracks Python environment dependencies (pandas,Flask) for reproducible builds.