SQLAlchemy dialect for OGC WFS
Project description
SQLAlchemy dialect for OGC WFS
SQLAlchemy dialect for OGC WFS as a Superset plugin.
Register the dialect
Create a requirements-local.txt file according to the
superset documentation
and insert following line:
superset_wfs_dialect
The dialect must then be registered in your superset config file,
e.g. superset_config_docker.py when using the
docker setup:
from sqlalchemy.dialects import registry
registry.register("wfs", "superset_wfs_dialect.dialect", "WfsDialect")
Start/restart superset and continue as described in the Start the application section.
Add a WFS database connection
- select Data > Connect database in the submenu
- choose "Other" at the list of "Supported Databases"
- insert the SQLAlchemy URI to a WFS
wfs://[...](i.e. replacehttps://of your WFS URL withwfs://) - if the service is secured via BasicAuth, the login details must be entered in the URL and is therefore stored unencrypted (
wfs://username:password@[...]) - the WFS must support GeoJSON output and e.g
outputFormat=application/jsonand needs to support EPSG:4326 as coordinate reference system - test the connection
- create a dataset
- create a chart/dashboard
Development
Prerequisites for development
- Docker Engine >= version 28
- python >= version 3.10.12
- Checkout this project
Installation
For debugging and code completion run via terminal within the project root:
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
or create a virtual environment via VS Code:
https://code.visualstudio.com/docs/python/python-tutorial#_create-a-virtual-environment.
Start superset with the registered plugin:
docker compose up -d --build
Integrate with a local Superset checkout (editable mode)
If you are developing this dialect together with a local Superset checkout, use an editable install inside the Superset container so code changes in this repository are picked up immediately.
- Superset is checked out in a sibling directory, e.g.
../superset../superset_wfs_dialect
- Superset is started via Docker Compose in development mode
In the Superset checkout:
-
Mount this repository into the Superset containers (e.g.
/app/superset_wfs_dialect). -
Add this line to
docker/requirements-local.txt:-e /app/superset_wfs_dialect
-
Register the dialect in
docker/pythonpath_dev/superset_config_docker.py:from sqlalchemy.dialects import registry registry.register("wfs", "superset_wfs_dialect.dialect", "WfsDialect")
-
Set the
DEBUGGERenv variable for the superset service in superset/docker-compose.yml to"1"to enable debugging in the container. -
Restart the relevant services, for example:
docker compose restart superset superset-worker superset-worker-beat
After restart, connect a database in Superset using a wfs://... SQLAlchemy URI as described above.
Debugging during development
Debugging can be activated via the VS Code during development using F5.
Please note that the Python interpreter is selected from the previously created venv.
Breakpoints set in VS Code are then taken into account.
Start the application
When in development mode, open http://localhost:8088/ . Otherwise, please open the corresponding URL to the installed superset instance.
Publishing a Development Version to PyPI
Requirements
- You must be on the main branch
- Your working directory must be clean (no uncommitted changes)
- You have push access to the repository
- A valid
PYPI_TOKENis configured in GitHub Secrets (used by the GitHub Actions workflow)
Releasing a new version
-
Run the release script with the desired version number (e.g.
0.0.1):./release.sh 0.0.1
This will:
- Update the
versionfield insetup.py - Commit the change to
main - Create a Git tag e.g.
0.0.1 - Push the tag to GitHub
- Update the
-
The GitHub Actions workflow will be triggered by the tag:
- It will build the package
- Upload it to PyPI
Notes
- Versions must follow the format
X.Y.Z(e.g.0.1.0)
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 superset_wfs_dialect-0.0.13.tar.gz.
File metadata
- Download URL: superset_wfs_dialect-0.0.13.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5c171d027882ac844cd34edd12bade121f74f4a08cbafab0c85a14c8cc61845
|
|
| MD5 |
d64c72757a7763dbecb763d2ae86a1a2
|
|
| BLAKE2b-256 |
2ce62a2d12d3cdab7b3ee7fa26fac7c90ff65432dcac1ea76bf0ad4361ee7678
|
File details
Details for the file superset_wfs_dialect-0.0.13-py3-none-any.whl.
File metadata
- Download URL: superset_wfs_dialect-0.0.13-py3-none-any.whl
- Upload date:
- Size: 37.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfe91d174ec5637bb12f5a902984a4cff71a20c16e50f710d70f1e4a06f56944
|
|
| MD5 |
0e85a4a747e0aa76036779eaaaa9bd5d
|
|
| BLAKE2b-256 |
528f2228a871f34ae336733e0d9136e3780ede3c38e335b0b85270aa566a70b2
|