Skip to main content

Simplify JSON to HTML conversion

Project description

Floods-HTML

Floods-HTML is a python package to simplify the generation of HTML pages of flood forecasting products typically provided for EFAS and GloFAS.

Installation

Clone source code repository

$ git clone https://github.com/ecmwf/floods-html.git
$ cd floods-html

Create and activate conda environment

$ conda create -n floods_html python=3.10
$ conda activate floods_html

For default installation, run

$ pip install .

For a developer installation (includes linting and test libraries), run

$ pip install -e .[dev]
$ pre-commit install

If you only plan to run the tests, instead run

$ pip install -e .[test]

If you plan to build a source and a wheel distribution, it is additionally required to run

$ pip install build

Usage

Supported JSON Format

{"data": [
    {"type": OBJECT_NAME, "data": OBJECT},
    {"type": OBJECT_NAME, "data": OBJECT},
    ...
]}

Supported objects are currently

  • "svg_figure"
{
    "title": FIGURE_NAME,
    "name": FIGURE_FILENAME,
}
  • "table"
{
    "title": TABLE_NAME,
    "header": [
        TABLE_ENTRY,
        TABLE_ENTRY,
        ...
    ],
    "rows": [
        [
            TABLE_ENTRY,
            TABLE_ENTRY,
            ...
        ],
        [
            TABLE_ENTRY,
            TABLE_ENTRY,
            ...
        ],
        ...
    ]
}

where a table entry is

{
    "value": ENTRY_VALUE,
    "style": DICTIONARY_OF_CSS_OPTIONS (optional),
    "class_name": CLASS_STRING (optional),
    "id": ID_STRING (optional)
    "col_span": INT (optional),
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

floods_html-0.5.0.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

floods_html-0.5.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file floods_html-0.5.0.tar.gz.

File metadata

  • Download URL: floods_html-0.5.0.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for floods_html-0.5.0.tar.gz
Algorithm Hash digest
SHA256 0c84a3b90f416498f4f067dd6fb81828ff663864b3dad658b233ae4bf4b0fcac
MD5 3b271332601aba9a6c3748fabd880808
BLAKE2b-256 3a29b90fd6949fabb3c3479b7e2cee039dee4c74325dd58b78003fbb2d37c417

See more details on using hashes here.

File details

Details for the file floods_html-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: floods_html-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for floods_html-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be884ba43be0c4ce5504b65b59a749c6b9cc26491eb2048c58d729941fec6c11
MD5 b50575a62e8423a6b01a970da4e8a792
BLAKE2b-256 d83c71329570bb0e01fb10f2a3ff89b8d9d7d9037bc33199bf3c8cad0fb200c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page