Qt application to transform raw tables into clean geographic data.
Project description
Geo-Importer
A PySide6 application to upload statistics in Excel, CSV, or PDF formats. Extract and prepare tables, then assign geographic data (NUTS 0–3, LAU, and LOR).
Table of Contents
Features
Geo-Importer guides you step-by-step through:
-
Upload – load Excel, CSV or PDF files
-
PDF Area – select table regions in PDFs
-
Worksheet – choose an Excel sheet
-
Data Prep – clean and trim your data
-
Columns & Filter – pick columns and apply filters
-
Geo Filter – filter reference geodata (NUTS/LAU)
-
Mapping – auto-match statistics to regions
-
Manual Mapping – adjust any unmatched rows
-
Preview – view results on an interactive map
-
Export – save as CSV or GeoJSON
flowchart TB
Upload[Upload]
PDFArea[PDF Area]
Worksheet[Worksheet]
DataPrep[DataPrep]
ColumnsFilter[Columns & Filter]
GeoFilter[Geo Filter]
Mapping[Mapping]
ManualMapping[Manual Mapping]
Preview[Preview]
Export[Export]
Upload <--> PDFArea
Upload <--> Worksheet
Upload <--> DataPrep
PDFArea <--> DataPrep
Worksheet <--> DataPrep
DataPrep <--> ColumnsFilter
ColumnsFilter <--> GeoFilter
GeoFilter <--> Mapping
Mapping <--> ManualMapping
ManualMapping <--> Preview
Preview <--> Export
A shared DataStore keeps intermediate results so each step stays decoupled. Core logic lives in src/core, and the Qt views are under src/views.
Project Layout
geo-importer/
├── src/ # Code packages
│ ├── core/ # Workflow logic & DataStore
│ ├── views/ # Qt UI for each step
│ ├── mapper/ # Matching algorithms & widgets
│ ├── models/ # Qt model classes
│ ├── geodata/ # Built-in reference CSVs
│ └── main.py # Entry point
├── data/ # Sample tables for testing
├── static/ # Generated assets
├── tests/ # Unit tests
└── docs/ # MkDocs site
Quick Start
Clone the repo and enter the folder:
git clone https://github.com/frievoe97/geo-importer.git
cd geo-importer
Run Locally
-
Create a Python 3.12+ virtual env and install:
python3.12 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install .
-
Launch the GUI:
python main.py -
Run tests:
pytest -v -
Clean up:
deactivate rm -rf .venv dist build geo_importer.egg-info
Build & Install Locally
-
Prepare env and install build tools:
python3.12 -m venv .venv source .venv/bin/activate pip install . pip install --upgrade build
-
Build package:
python -m build
-
Install wheel & run:
pip install dist/geo_importer-*.whl geo-importer
-
Test and clean up as above.
Publish to PyPI
-
Build wheel and install twine:
python3.12 -m venv .venv source .venv/bin/activate pip install --upgrade build twine python -m build
-
Upload:
twine upload dist/*
-
Clean up
.venv,dist/,build/.
Automated publishing via GitHub Actions
- Add your PyPI API key as the
PYPI_API_TOKENsecret in the GitHub repository - Bump the version in
pyproject.tomlandsrc/main.pyusing the helper script:
scripts/bump_version.py 0.0.1b1
- Commit the changes on your
releasebranch and create a tag that starts withv:
git tag v0.0.1b1
git push origin release --tags
Pushing the tag triggers .github/workflows/pypi.yml. It runs the test suite,
builds the wheel and uploads the package to PyPI automatically.
Documentation
Run the helper script to generate API docs and serve them locally via MkDocs:
python generate_api_docs.py
mkdocs serve -f docs/mkdocs.yml
Continuous Integration / Tests
The project uses GitHub Actions to run formatting checks, linting, and tests on push and pull requests. The workflow supports Python 3.12 and 3.13:
name: Tests
on:
push:
branches: [ main ]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Qt dependencies
run: sudo apt-get update && sudo apt-get install -y libegl1 libxkbfile1
- name: Install tools
run: pip install nox black ruff
- name: Run black
run: black src tests main.py --check
- name: Run ruff
run: ruff check .
- name: Run tests
env:
QT_QPA_PLATFORM: offscreen
QTWEBENGINE_DISABLE_SANDBOX: 1
run: nox -s tests-${{ matrix.python-version }}
Code Formatting & Cleanup
You can automatically format and lint the codebase locally using Black and Ruff:
# Format all Python files
black src tests main.py
# Apply Ruff fixes (if any)
ruff check .
Documentation
Generate and serve docs:
python generate_api_docs.py
mkdocs serve -f docs/mkdocs.yml
Docs auto-publish to GitHub Pages on release tags.
License
Distributed under the MIT License. See LICENSE for details.
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 geo_importer-0.0.1b1.tar.gz.
File metadata
- Download URL: geo_importer-0.0.1b1.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d756525eaf196c185478d9315410b7ab18ced98338743df29dc3499b2a2c614c
|
|
| MD5 |
061afedf1c74c28cc9f58a2ffd810cab
|
|
| BLAKE2b-256 |
aa7e73eda16865946062727584c86d07af9cb7f31de84f4a7b0e0779cabc037b
|
File details
Details for the file geo_importer-0.0.1b1-py3-none-any.whl.
File metadata
- Download URL: geo_importer-0.0.1b1-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07c29d7b7b676daa0b36a719bd5c91f03d4ffadc9fbd835cae54767e92ff5271
|
|
| MD5 |
e9b2e5afc39049f5ffb34aad4c42066b
|
|
| BLAKE2b-256 |
46f7900e5c24fdfb6e88bf24552d9f66f3445488ea25191cbcd127688a6709ff
|