Skip to main content

SQLAlchemy dialect for OGC WFS

Coverage Reliability Rating Maintainability Rating Security Rating

SQLAlchemy dialect for OGC WFS as a Superset plugin.

Compatible with Apache Superset 6.x (Versions >0.0.15).

Compatible with Apache Superset 5.x (Versions <=0.0.15).

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 Settings > Database Connections
  • Click "+ Database"
  • select "OGC WFS" at the list of "Supported Databases"
  • insert the WFS URL into the host field (e.g. https://example.com/geoserver/wfs)
  • if the service is secured via BasicAuth, add username and password via the provided fields
  • if the service is secured via OIDC/OAUTH2, add the required parameters into the OAuth2 client information section
    • required fields: Client ID, Client Secret, Token Request URI
    • optional fields: Scopes
    • fields to ignore: Authorization Request URI (added by superset but not needed for the client credentials flow)
  • the WFS must support GeoJSON output (e.g outputFormat=application/json), and needs to support EPSG:4326 as coordinate reference system
  • create a dataset
  • create a chart/dashboard

Development

Prerequisites for development

  • python >= version 3.10.12
  • Checkout of 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.

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:

  1. Mount this repository into the Superset containers (e.g. /app/superset_wfs_dialect).

  2. Add this line to docker/requirements-local.txt:

    -e /app/superset_wfs_dialect
    
  3. Register the dialect in docker/pythonpath_dev/superset_config_docker.py:

    from sqlalchemy.dialects import registry
    registry.register("wfs", "superset_wfs_dialect.dialect", "WfsDialect")
    
  4. Set the DEBUGGER env variable for the superset service in superset/docker-compose.yml to "1" to enable debugging in the container.

  5. 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

For interactive debugging in the local Superset checkout, make sure that superset opens the debug port for the debugger to attach.

E.g.

python -m debugpy --listen 0.0.0.0:5678 -m flask run -p 8088 --host=0.0.0.0 --reload --debugger

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 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_TOKEN is configured in GitHub Secrets (used by the GitHub Actions workflow)

Releasing a new version

  1. Run the release script with the desired version number (e.g. 0.0.1):

    ./release.sh 0.0.1
    

    This will:

    • Update the version field in setup.py
    • Commit the change to main
    • Create a Git tag e.g. 0.0.1
    • Push the tag to GitHub
  2. 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)

Metadata

Release files for superset-wfs-dialect 0.0.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for superset-wfs-dialect 0.0.16
File Size Uploaded Provenance Actions
superset_wfs_dialect-0.0.16.tar.gz 44.1 kB Without provenance Details for superset_wfs_dialect-0.0.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for superset-wfs-dialect 0.0.16
File Interpreter ABI Platform Actions
superset_wfs_dialect-0.0.16-py3-none-any.whl Python 3 none any Details for superset_wfs_dialect-0.0.16-py3-none-any.whl

Total release size: 95.5 kB

Release files / superset_wfs_dialect-0.0.16.tar.gz

Download URL superset_wfs_dialect-0.0.16.tar.gz
Size 44.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dbb3c7db5ac94ec479d239e05d882d6e975743081475b0b132b12742edc7fd8f
BLAKE2b-256 checksum
How to use checksums
c03c663f5cf55bb6ac618a64a5847a368bd010c7b35849c8e0feaa344f56f9a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / superset_wfs_dialect-0.0.16-py3-none-any.whl

Download URL superset_wfs_dialect-0.0.16-py3-none-any.whl
Size 51.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
207a0d5b1da9ddc7bdde23fb34b61fd2ad89a40150c788c58abd28244fe70941
BLAKE2b-256 checksum
How to use checksums
3c780a150270acd5d87816e1aba6ab1bcf58e1beb0736a783ed0fd35678789d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for superset-wfs-dialect 0.0.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page