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),
"text_color": ENTRY_COLOUR_HEX (optional),
"col_span": INT (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
Built Distribution
File details
Details for the file floods_html-0.2.0.tar.gz
.
File metadata
- Download URL: floods_html-0.2.0.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46f9c11d94afeaee7cdf1f96347501fc84550863679de6bf47f9d492d90e7348 |
|
MD5 | 71c6ba49d230acd2c8bab0cf3d7231bb |
|
BLAKE2b-256 | bb0de3781e6c8c1b3d6c6f9fc4a10eceade1c777b0626d015e0748b7d2f1af1e |
File details
Details for the file floods_html-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: floods_html-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c12610c909e9e411cc4bfdf17b7388347e4053c256fe67beceb723f5d6517c42 |
|
MD5 | 225afd3dea13ad2af83ab4c6f4ff03a2 |
|
BLAKE2b-256 | 2894fc646f9adcaf181133af55160a25948375594c748364b4716e2d134d85b9 |