opendrift-leeway-webgui


Nameopendrift-leeway-webgui JSON
Version 2024.1.0 PyPI version JSON
download
home_page
SummaryWeb GUI for Leeway simulations with OpenDrift
upload_time2024-01-30 08:08:58
maintainer
docs_urlNone
author
requires_python>=3.8
licenseApache2 2.0 License
keywords opendrift leeway sar search rescue simulation drift
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![GitHub Workflow Status](https://github.com/digitalfabrik/opendrift-leeway-webgui/workflows/Tests/badge.svg)](https://github.com/digitalfabrik/opendrift-leeway-webgui/actions?query=workflow%3ATests)
[![Pylint](https://img.shields.io/badge/pylint-10.00-brightgreen)](https://www.pylint.org/)
[![PyPi](https://img.shields.io/pypi/v/opendrift-leeway-webgui.svg)](https://pypi.org/project/opendrift-leeway-webgui/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# About

This is a little Django web application that does an [OpenDrift](https://github.com/OpenDrift/opendrift) [Leeway](https://opendrift.github.io/choosing_a_model.html) simulation with a set of provided parameters via a web form. The result is sent to a user via e-mail.

This is an experimental tool to help Search and Rescue operations. An experimental service is available at [leeway.tuerantuer.org](https://leeway.tuerantuer.org).

Sample output from the leeway tool (100 points, 1km radius, south of Lampedusa):

![Example leeway output](./.github/leeway-simulation-output.png)

# Usage

Django users have to be created in the CRUD backend, available at https://leeway.example.com/admin. E-mail addresses should be added for users as they receive the result via e-mail.

The program regularly fetches incoming mails via IMAP and starts simulations from key-value-pairs in the mail subject or text body. The sender of the mail needs to have an associated account. Allowed keys via e-mail are: `longitude`, `latitude`, `object_type`, `radius`, `duration`, `start_time`. The separator between key and value is `=`. Key-value-pairs are separated by `;` in the subject and by new lines in the text body. The date format for start date is `YYYY-MM-DD HH:MM:SS`.

# API usage

API documentation can be found at: https://leeway.tuerantuer.org/api/docs/

Authentication can be provided in two ways:
1. Via your session cookie, obtained from the normal login
2. Via an authentication token, can be obtained via [/api/auth/login/](https://leeway.tuerantuer.org/api/v1/docs/#/auth/auth_login_create)

# Installation

**Prerequisite:** _Python 3.8 or later is required._

1. Clone this repository and change into the new directory:
   ```bash
   git clone git@github.com:digitalfabrik/opendrift-leeway-webgui.git leeway
   cd leeway
   ```
2. Create a virtual environment outside of the project directory and activate it:
   ```bash
   python3 -m venv ~/.venv
   source ~/.venv/bin/activate
   ```
3. Install the dependencies:
   ```bash
   pip install -e .[dev]
   ```
4. Create minimal config file `/etc/opendrift-leeway-webgui.ini` to enable `DEBUG` mode:
   ```dosini
   [base]
   DEBUG = True
   ```
5. Initialize the database:
   ```bash
   cd opendrift_leeway_webgui
   python3 manage.py migrate
   python3 manage.py createsuperuser
   ```
6. Build the enhanced Docker container:
   ```bash
   cd opendrift
   docker build -t opendrift-leeway-custom .
   ```

# Development Server

1. Switch into the cloned project and then into the `opendrift_leeway_webgui` subdirectory.
2. Open two terminals:
   1. In the first terminal run:
      ```bash
      source ../.venv/bin/activate
      python3 manage.py runserver
      ```
   2. In the second terminal run:
      ```bash
      source ../.venv/bin/activate
      celery -A leeway worker -l INFO
      ```


# Releasing

Run `bumpver update` to perform the following tasks with one command:

1. Bump the version in `pyproject.toml`
2. Create a version bump commit
3. Create a new version tag
4. Push the commit and tag
5. Create a new release on PyPI via GitHub Actions


# Production Server

This details the installation on Debian with Apache2 and mod_wsgi.

1. Create target directory on the production system:
   ```bash
   sudo mkdir /opt/iopendrift-leeway-webgui
   sudo chown www-data:www-data /opt/opendrift-leeway-webgui
   ```
2. Create the virtual environment:
   ```bash
   sudo -u www-data bash
   python3 -m venv .venv
   source .venv/bin/activate
   ```
3. Install the application into the virtual environment:
   ```bash
   pip install opendrift-leeway-webgui
   ```
4. Copy the example config file to `/etc/opendrift-leeway-webgui.ini` and fill in the template
5. Install Docker and add the `docker` group to the `www-data` user.
6. Create symlink to facilitate the Apache configuration:
   ```bash
   ln -s $(python -c "from opendrift_leeway_webgui.core import wsgi; print(wsgi.__file__)") .
   ```
7. Configure Apache2 according to the example.
8. Set up Celery worker with `leeway-celery.service` and start the service.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "opendrift-leeway-webgui",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "OpenDrift,Leeway,SAR,Search,Rescue,Simulation,Drift",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/1e/be/2b166f48defc872730ad73eda2dd8d636ff778e12a57df4483e223186671/opendrift-leeway-webgui-2024.1.0.tar.gz",
    "platform": null,
    "description": "[![GitHub Workflow Status](https://github.com/digitalfabrik/opendrift-leeway-webgui/workflows/Tests/badge.svg)](https://github.com/digitalfabrik/opendrift-leeway-webgui/actions?query=workflow%3ATests)\n[![Pylint](https://img.shields.io/badge/pylint-10.00-brightgreen)](https://www.pylint.org/)\n[![PyPi](https://img.shields.io/pypi/v/opendrift-leeway-webgui.svg)](https://pypi.org/project/opendrift-leeway-webgui/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n# About\n\nThis is a little Django web application that does an [OpenDrift](https://github.com/OpenDrift/opendrift) [Leeway](https://opendrift.github.io/choosing_a_model.html) simulation with a set of provided parameters via a web form. The result is sent to a user via e-mail.\n\nThis is an experimental tool to help Search and Rescue operations. An experimental service is available at [leeway.tuerantuer.org](https://leeway.tuerantuer.org).\n\nSample output from the leeway tool (100 points, 1km radius, south of Lampedusa):\n\n![Example leeway output](./.github/leeway-simulation-output.png)\n\n# Usage\n\nDjango users have to be created in the CRUD backend, available at https://leeway.example.com/admin. E-mail addresses should be added for users as they receive the result via e-mail.\n\nThe program regularly fetches incoming mails via IMAP and starts simulations from key-value-pairs in the mail subject or text body. The sender of the mail needs to have an associated account. Allowed keys via e-mail are: `longitude`, `latitude`, `object_type`, `radius`, `duration`, `start_time`. The separator between key and value is `=`. Key-value-pairs are separated by `;` in the subject and by new lines in the text body. The date format for start date is `YYYY-MM-DD HH:MM:SS`.\n\n# API usage\n\nAPI documentation can be found at: https://leeway.tuerantuer.org/api/docs/\n\nAuthentication can be provided in two ways:\n1. Via your session cookie, obtained from the normal login\n2. Via an authentication token, can be obtained via [/api/auth/login/](https://leeway.tuerantuer.org/api/v1/docs/#/auth/auth_login_create)\n\n# Installation\n\n**Prerequisite:** _Python 3.8 or later is required._\n\n1. Clone this repository and change into the new directory:\n   ```bash\n   git clone git@github.com:digitalfabrik/opendrift-leeway-webgui.git leeway\n   cd leeway\n   ```\n2. Create a virtual environment outside of the project directory and activate it:\n   ```bash\n   python3 -m venv ~/.venv\n   source ~/.venv/bin/activate\n   ```\n3. Install the dependencies:\n   ```bash\n   pip install -e .[dev]\n   ```\n4. Create minimal config file `/etc/opendrift-leeway-webgui.ini` to enable `DEBUG` mode:\n   ```dosini\n   [base]\n   DEBUG = True\n   ```\n5. Initialize the database:\n   ```bash\n   cd opendrift_leeway_webgui\n   python3 manage.py migrate\n   python3 manage.py createsuperuser\n   ```\n6. Build the enhanced Docker container:\n   ```bash\n   cd opendrift\n   docker build -t opendrift-leeway-custom .\n   ```\n\n# Development Server\n\n1. Switch into the cloned project and then into the `opendrift_leeway_webgui` subdirectory.\n2. Open two terminals:\n   1. In the first terminal run:\n      ```bash\n      source ../.venv/bin/activate\n      python3 manage.py runserver\n      ```\n   2. In the second terminal run:\n      ```bash\n      source ../.venv/bin/activate\n      celery -A leeway worker -l INFO\n      ```\n\n\n# Releasing\n\nRun `bumpver update` to perform the following tasks with one command:\n\n1. Bump the version in `pyproject.toml`\n2. Create a version bump commit\n3. Create a new version tag\n4. Push the commit and tag\n5. Create a new release on PyPI via GitHub Actions\n\n\n# Production Server\n\nThis details the installation on Debian with Apache2 and mod_wsgi.\n\n1. Create target directory on the production system:\n   ```bash\n   sudo mkdir /opt/iopendrift-leeway-webgui\n   sudo chown www-data:www-data /opt/opendrift-leeway-webgui\n   ```\n2. Create the virtual environment:\n   ```bash\n   sudo -u www-data bash\n   python3 -m venv .venv\n   source .venv/bin/activate\n   ```\n3. Install the application into the virtual environment:\n   ```bash\n   pip install opendrift-leeway-webgui\n   ```\n4. Copy the example config file to `/etc/opendrift-leeway-webgui.ini` and fill in the template\n5. Install Docker and add the `docker` group to the `www-data` user.\n6. Create symlink to facilitate the Apache configuration:\n   ```bash\n   ln -s $(python -c \"from opendrift_leeway_webgui.core import wsgi; print(wsgi.__file__)\") .\n   ```\n7. Configure Apache2 according to the example.\n8. Set up Celery worker with `leeway-celery.service` and start the service.\n",
    "bugtrack_url": null,
    "license": "Apache2 2.0 License",
    "summary": "Web GUI for Leeway simulations with OpenDrift",
    "version": "2024.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/digitalfabrik/opendrift-leeway-webgui/issues",
        "Homepage": "https://leeway.tuerantuer.org",
        "Source Code": "https://github.com/digitalfabrik/opendrift-leeway-webgui"
    },
    "split_keywords": [
        "opendrift",
        "leeway",
        "sar",
        "search",
        "rescue",
        "simulation",
        "drift"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "300b438a95c390afbd2888ca1167e08675d29a9f24638dad2e0c0b3de64dcb1f",
                "md5": "f7926865e0c71dd5bb58b6380d8df707",
                "sha256": "a32e53f29d86bf70449f7368ed31400ed734d8f468c65b89baab828e58deefed"
            },
            "downloads": -1,
            "filename": "opendrift_leeway_webgui-2024.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f7926865e0c71dd5bb58b6380d8df707",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 218122,
            "upload_time": "2024-01-30T08:08:56",
            "upload_time_iso_8601": "2024-01-30T08:08:56.588182Z",
            "url": "https://files.pythonhosted.org/packages/30/0b/438a95c390afbd2888ca1167e08675d29a9f24638dad2e0c0b3de64dcb1f/opendrift_leeway_webgui-2024.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ebe2b166f48defc872730ad73eda2dd8d636ff778e12a57df4483e223186671",
                "md5": "ed5b1c7f4853f853e3b66acaa70e90f0",
                "sha256": "da593cda951024407f0570d997386f8b4dfe635e27a3b34ead7e1cab3ca65091"
            },
            "downloads": -1,
            "filename": "opendrift-leeway-webgui-2024.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ed5b1c7f4853f853e3b66acaa70e90f0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 209842,
            "upload_time": "2024-01-30T08:08:58",
            "upload_time_iso_8601": "2024-01-30T08:08:58.130958Z",
            "url": "https://files.pythonhosted.org/packages/1e/be/2b166f48defc872730ad73eda2dd8d636ff778e12a57df4483e223186671/opendrift-leeway-webgui-2024.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-30 08:08:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "digitalfabrik",
    "github_project": "opendrift-leeway-webgui",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "opendrift-leeway-webgui"
}
        
Elapsed time: 0.17544s