Geo-Importer
Geo-Importer is a simple desktop app built with PySide6. You can upload your statistics in Excel, CSV, or PDF formats, extract and clean the tables, and then match your data to geographic regions (NUTS levels 0–3, LAU, LOR). Finally, you can export the matched data as CSV or GeoJSON.
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:
bash python3.12 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install . -
Launch the GUI:
bash python main.py -
Run tests:
bash pytest -v -
Clean up:
bash deactivate rm -rf .venv dist build geo_importer.egg-info
Build & Install Locally
-
Prepare env and install build tools:
bash python3.12 -m venv .venv source .venv/bin/activate pip install . pip install --upgrade build -
Build package:
bash python -m build -
Install wheel & run:
bash pip install dist/geo_importer-*.whl geo-importer -
Test and clean up as above.
Publish to PyPI
-
Build wheel and install twine:
bash python3.12 -m venv .venv source .venv/bin/activate pip install --upgrade build twine python -m build -
Upload:
bash 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.1b914
- Commit the changes on your
releasebranch and create a tag that starts withv:
git tag v0.0.1b914
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
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.