A command line tool to generate html tables with embedded images, videos and audio
Project description
htmltable cli
Command line tool to convert lists to portable html tables with embedded audios and images.
![][https://raw.githubusercontent.com/FarisHijazi/htmltable-cli/master/images/longexample.gif)
Installation
From source (latest)
pip install git+https://github.com/FarisHijazi/htmltable-cli
From pypi (table)
pip install htmltable-cli
Usage
usage:
A command line tool to generate html tables with embedded images, videos and audio
- Separate columns with `,`
- The easiest way to use it is to put each column in a folder and then pass it using a wildcard `*`
Examples:
htmltable col1/*.* , col2/*.* , col3/*.* --title "my table" --controls controls preload autoplay loop muted --base64 --index > output.html
[-h] [--title TITLE] [-c COLNAMES [COLNAMES ...]] [-b] [-x | -fx] [--controls [{controls,preload,autoplay,loop,muted} [{controls,preload,autoplay,loop,muted} ...]]] [-t] [--clamp] data [data ...]
positional arguments:
data input table data. Format: col1_item1 col1_item2 col1_item3 , col2_item1 col2_item2 col2_item3 ...
optional arguments:
-h, --help show this help message and exit
--title TITLE title heading for the table
-c COLNAMES [COLNAMES ...], --colnames COLNAMES [COLNAMES ...]
Provide a list of column names (instead of automatically inferring column names from filepaths).
-b, --base64 Encode all the media to a base64 URL, meaning that the html file is now portable and doesn't depend on the location of the images/audios/videos
-x, --index add numerical index column
-fx, --filename_index
Infer index (rowname) based on row filenames, instead of numerical index. All columns must have identical filenames otherwise an error is raised
--controls [{controls,preload,autoplay,loop,muted} [{controls,preload,autoplay,loop,muted} ...]]
HTML video and audio controls
-t, --transpose swap columns and rows
--clamp clamp number of rows to the shortest row, ensures the table is symmetric.
Assuming filestructure:
.
|-- col1
| |-- audio1.wav
| |-- ...
| |-- image.png
| `-- video.mp4
|-- col2
| |-- audio1.wav
| |-- ...
| |-- image.png
| `-- video.mp4
`-- col3
|-- audio1.wav
|-- ...
|-- image.png
`-- video.mp4
Examples
Minimal example
htmltable col1/audio1.wav , col2/audio1.wav , col3/audio1.wav > output.html
(you don't actually have to organize your arguments in a new lines :p)
![][https://raw.githubusercontent.com/FarisHijazi/htmltable-cli/master/images/minimal.png)
More involved example
htmltable col1/*.* , \
col2/*.* , \
col3/*.* \
--controls controls preload autoplay loop muted \
--base64 --index > output.html
![][https://raw.githubusercontent.com/FarisHijazi/htmltable-cli/master/images/longexample.gif)
Explaination
--base64
will encode all the media to a base64 URL, meaning that the html file is now portable and doesn't depend on the location of the images/audios/videoscol1/*.*
passes all files incol1/
directory--controls controls preload autoplay loop muted
set default video and audio attributes
Column and row headers
- Column headers are infered automatically, to manually specify columnames, use
-c
/--colnames
- Row headers options:
-
Can be left blank
-
Indexed numerically using
-x
/--index
-
Use the filenames, if all files have the same name across columns, using
-fx
/--filename_index
.Example: col1/audio1.wav, col2/audio2.wav.
-
Known issues
- Outputting files is only supported in the
.
dir. i.ehtmltable .... > some/other/path/output.html
has issues when not using--base64
- setting
--controls autoplay
won't work, you need to addmuted
as well
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
Hashes for htmltable_cli-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59da67caeadf519667c736511409501bc3b3608e11ee7f87af78b697ec501c15 |
|
MD5 | c8eaea4a136d79579cbb41e11a4307ac |
|
BLAKE2b-256 | 2aa9fb1ef4694d77cb1ca433476e489bd81abf6012a973cc695befd7d7a47ef9 |