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.3.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

floods_html-0.3.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: floods_html-0.3.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for floods_html-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d9d04fda2646d5c50f5205728657b2b27f4028b89d40105619a851badaf820e7
MD5 e6e8c04fe529095484db2c9f0aa5cc79
BLAKE2b-256 baf21cebe127f128e83b69c87951bf628b557c0f5dacea3b96b3f0ed6ec83db4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: floods_html-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for floods_html-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a95b6be7f38335f77ec962e27219d97ce12e6cff4f8b46dabebc2008bd458719
MD5 87a55d0b0e9633f866665a99a27d6477
BLAKE2b-256 05472af9487d001076983af330ad5baaf067a755e42f59c69ec061a12ed06ec1

See more details on using hashes here.

Supported by

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