Metadata-Version: 2.4
Name: geo-importer
Version: 0.0.1b1
Summary: Qt application to transform raw tables into clean geographic data.
Author-email: frievoe97 <friedrich.voelkers@me.com>
License: MIT
Project-URL: Homepage, https://friedrichvoelkers.de
Project-URL: Repository, https://github.com/frievoe97/geo-importer
Project-URL: Issues, https://github.com/frievoe97/geo-importer/issues
Keywords: qt,geodata,import,gui,mapping
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: acres==0.5.0
Requires-Dist: aiofiles==24.1.0
Requires-Dist: anyio==4.9.0
Requires-Dist: black==25.1.0
Requires-Dist: branca==0.8.1
Requires-Dist: camelot-py==1.0.0
Requires-Dist: certifi==2025.4.26
Requires-Dist: cffi==1.17.1
Requires-Dist: chardet==5.2.0
Requires-Dist: charset-normalizer==3.4.2
Requires-Dist: ci-info==0.3.0
Requires-Dist: click==8.2.1
Requires-Dist: configobj==5.0.9
Requires-Dist: configparser==7.2.0
Requires-Dist: contourpy==1.3.2
Requires-Dist: cryptography==45.0.4
Requires-Dist: cycler==0.12.1
Requires-Dist: docopt==0.6.2
Requires-Dist: et_xmlfile==2.0.0
Requires-Dist: etelemetry==0.3.1
Requires-Dist: filelock==3.18.0
Requires-Dist: folium==0.19.7
Requires-Dist: fonttools==4.58.2
Requires-Dist: h11==0.16.0
Requires-Dist: httplib2==0.22.0
Requires-Dist: idna==3.10
Requires-Dist: iniconfig==2.1.0
Requires-Dist: itsdangerous==2.2.0
Requires-Dist: Jinja2==3.1.6
Requires-Dist: kiwisolver==1.4.8
Requires-Dist: looseversion==1.3.0
Requires-Dist: lxml==5.4.0
Requires-Dist: MarkupSafe==3.0.2
Requires-Dist: matplotlib==3.10.3
Requires-Dist: mypy_extensions==1.1.0
Requires-Dist: networkx==3.5
Requires-Dist: nibabel==5.3.2
Requires-Dist: nipype==1.10.0
Requires-Dist: nox==2025.5.1
Requires-Dist: numpy==2.3.0
Requires-Dist: opencv-python-headless==4.11.0.86
Requires-Dist: openpyxl==3.1.5
Requires-Dist: packaging==25.0
Requires-Dist: pandas==2.3.0
Requires-Dist: pathlib==1.0.1
Requires-Dist: pathspec==0.12.1
Requires-Dist: pdfminer.six==20250506
Requires-Dist: pillow==11.2.1
Requires-Dist: pipreqs==0.4.13
Requires-Dist: platformdirs==4.3.8
Requires-Dist: pluggy==1.6.0
Requires-Dist: prov==2.0.2
Requires-Dist: puremagic==1.29
Requires-Dist: pycparser==2.22
Requires-Dist: pydot==4.0.0
Requires-Dist: Pygments==2.19.1
Requires-Dist: PyMuPDF==1.26.0
Requires-Dist: pyparsing==3.2.3
Requires-Dist: pypdf==5.6.0
Requires-Dist: pypdfium2==4.30.1
Requires-Dist: pyproj==3.7.1
Requires-Dist: PySide6==6.9.1
Requires-Dist: PySide6_Addons==6.9.1
Requires-Dist: PySide6_Essentials==6.9.1
Requires-Dist: pytest==8.4.0
Requires-Dist: python-dateutil==2.9.0.post0
Requires-Dist: pytz==2025.2
Requires-Dist: pyxnat==1.6.3
Requires-Dist: PyYAML==6.0.2
Requires-Dist: RapidFuzz==3.13.0
Requires-Dist: rdflib==7.1.4
Requires-Dist: requests==2.32.4
Requires-Dist: ruff==0.11.13
Requires-Dist: scipy==1.15.3
Requires-Dist: shiboken6==6.9.1
Requires-Dist: simplejson==3.20.1
Requires-Dist: six==1.17.0
Requires-Dist: sniffio==1.3.1
Requires-Dist: starlette==0.47.0
Requires-Dist: tabulate==0.9.0
Requires-Dist: tools==1.0.2
Requires-Dist: traits==7.0.2
Requires-Dist: tzdata==2025.2
Requires-Dist: urllib3==2.4.0
Requires-Dist: uvicorn==0.34.3
Requires-Dist: xyzservices==2025.4.0
Requires-Dist: yarg==0.1.10
Dynamic: license-file

<p align="center">
  <img src="https://raw.githubusercontent.com/frievoe97/geo-importer/refs/heads/main/src/app_icon.png?token=GHSAT0AAAAAADB2CNRIPPYPE4LCTMHBGHSE2CLB4OA" alt="App Icon" width="100" />
</p>

![Python](https://img.shields.io/badge/python-3.12%2B-blue) ![PySide6](https://img.shields.io/badge/PySide6-6.9.1-blue) ![pandas](https://img.shields.io/badge/pandas-2.3.0-blue) ![folium](https://img.shields.io/badge/folium-0.19.7-blue) ![camelot--py](https://img.shields.io/badge/camelot--py-1.0.0-orange) ![openpyxl](https://img.shields.io/badge/openpyxl-3.1.5-blue) ![PyMuPDF](https://img.shields.io/badge/PyMuPDF-1.26.0-blue) ![python--dateutil](https://img.shields.io/badge/python--dateutil-2.9.0_post0-blue) ![RapidFuzz](https://img.shields.io/badge/RapidFuzz-3.13.0-orange) ![License](https://img.shields.io/badge/license-MIT-yellow)

# 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](#features)
    
-   [Project Layout](#project-layout)
    
-   [Quick Start](#quick-start)
    
    -   [Run Locally](#run-locally)
        
    -   [Build & Install](#build--install)
        
    -   [Publish to PyPI](#publish-to-pypi)
        
-   [Documentation](#documentation)
    
-   [License](#license)
    

----------

## Features

Geo-Importer guides you step-by-step through:

1.  **Upload** – load Excel, CSV or PDF files
    
2.  **PDF Area** – select table regions in PDFs
    
3.  **Worksheet** – choose an Excel sheet
    
4.  **Data Prep** – clean and trim your data
    
5.  **Columns & Filter** – pick columns and apply filters
    
6.  **Geo Filter** – filter reference geodata (NUTS/LAU)
    
7.  **Mapping** – auto-match statistics to regions
    
8.  **Manual Mapping** – adjust any unmatched rows
    
9.  **Preview** – view results on an interactive map
    
10.  **Export** – save as CSV or GeoJSON
    
```mermaid
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:
```bash
git clone https://github.com/frievoe97/geo-importer.git
cd geo-importer
```

### Run Locally

1.  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 .
    ```
    
2.  Launch the GUI:
    ```bash
    python main.py
    ```
    
3.  Run tests:
    ```bash
    pytest -v
    ```
    
4.  Clean up:
    ```bash
    deactivate
    rm -rf .venv dist build geo_importer.egg-info
    ```
    

### Build & Install Locally

1.  Prepare env and install build tools:
    ```bash
    python3.12 -m venv .venv
    source .venv/bin/activate
    pip install .
    pip install --upgrade build
    ```
    
2.  Build package:
    ```bash
    python -m build
    ```
    
3.  Install wheel & run:
    ```bash
    pip install dist/geo_importer-*.whl
    geo-importer
    ```
    
4.  Test and clean up as above.
    

### Publish to PyPI

1.  Build wheel and install twine:
    ```bash
    python3.12 -m venv .venv
    source .venv/bin/activate
    pip install --upgrade build twine
    python -m build
    ```
    
2.  Upload:
    ```bash
    twine upload dist/*
    ```
    
3.  Clean up `.venv`, `dist/`, `build/`.

----------

### Automated publishing via GitHub Actions

1. Add your PyPI API key as the `PYPI_API_TOKEN` secret in the GitHub repository
2. Bump the version in `pyproject.toml` and `src/main.py` using the helper script:

```bash
scripts/bump_version.py 0.0.1b1
```

3. Commit the changes on your `release` branch and create a tag that starts with `v`:

```bash
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:

```bash
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:
```yaml
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:
```bash
# Format all Python files
black src tests main.py

# Apply Ruff fixes (if any)
ruff check .
```

----------

## Documentation

Generate and serve docs:
```bash
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.
