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
"figure"
{
"title": FIGURE_NAME,
"name": FIGURE_FILENAME,
"width": FIGURE_WIDTH, (optional)
"height": FIGURE_HEIGHT (optional)
}
"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,
"background_color": ENTRY_COLOUR_HEX (optional)
}
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
floods_html-0.1.0.tar.gz
(20.4 kB
view hashes)
Built Distribution
Close
Hashes for floods_html-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f44d6fef715fd7e7525272042ffc8714ce2952488bf19272174cea59a88ca2bb |
|
MD5 | 8a38fa2f9b58419503cb4d32948831d5 |
|
BLAKE2b-256 | 4a30b4e6f1b1b7fe95b60fd816a2a2da0ee41a7324bde3e81d91e75f0496935b |