Back to Silas S. Brown's home page

Anemone DAISY maker

Anemone is a Python 3 script to put together a DAISY file from HTML text, MP3 audio recordings and time index data.

Anemone produces DAISY 2.02 files by default, or DAISY 3 (i.e. ANSI/NISO Z39.86) if an option is set. It currently can produce one of two different types of digital talking book:

  1. Full audio with basic Navigation Control Centre only: this requires a list of MP3 files for the audio, one MP3 per section, and the title of each section can be placed either in a separate text file or in the filename of the MP3 file.
  2. Full audio with full text: this requires MP3 files for the audio, corresponding XHTML files for the text, and corresponding JSON files for the timing synchronisation. Each JSON file is expected to contain a list called "markers" whose items contain "id" (or "paragraphId" or anything else ending id) and "time" (or "startTime" or anything else ending time), which can be in seconds, minutes:seconds or hours:minutes:seconds. The IDs in these JSON files should have corresponding attributes in the XHTML, by default data-pid but this can be changed with a command-line option.

All files are placed on the command line, and Anemone assumes the correspondences are ordered. So for example if MP3, HTML and JSON files are given, Anemone assumes the first-listed MP3 file corresponds with the first-listed HTML file and the first-listed JSON file, and so on for the second, third, etc. With most sensible file naming schemes, you should be able to use shell wildcards like * when passing the files to Anemone.

You may also set the name of an output file ending zip; the suffix _daisy.zip is common.

The title, publisher, language etc of the book should be set via command-line options: run the program with --help to see all.

Download anemone.py

History on GitHub

The daisy anemone is a sea creature on the rocky Western shores of Britain and Ireland; the Dorset Wildlife Trust says it's "usually found in deep pools or hiding in holes or crevices, or buried in the sediment with only tentacles displayed". Similarly this script has no interactive user interface; it hides away on the command line.

Behaviour of DAISY readers in 2024


All material © Silas S. Brown unless otherwise stated.