Local filesystem cache of data from an Enhydris server

Manual section:1


enhydris_cache [--traceback] config_file


enhydris_cache downloads data from Enhydris and stores them locally in the file system. The details of its operation are specified in the configuration file specified on the command line.


To install enhydris_cache, see Installation.

How to run it

First, you need to create a configuration file with a text editor such as vim, emacs, notepad, or whatever. Create such a file and name it, for example, /var/tmp/enhydris_cache.conf, or, on Windows, something like C:\Users\user\enhydris_cache.conf , with the following contents (the contents don’t matter at this stage, just copy and paste them from below):

[General] loglevel = INFO

Then, open a command prompt and give it this command:


enhydris_cache /var/tmp/enhydris_cache.conf


C:\Program Files\Pthelma\enhydris_cache.exe C:\Users\user\enhydris_cache.conf

(the details may differ; for example, in 64-bit Windows, it may be C:\Program Files (x86) instead of C:\Program Files.)

If you have done everything correctly, it should output an error message complaining that something in its configuration file isn’t right.

Configuration file example

Take a look at the following example configuration file and read the explanatory comments that follow it:

loglevel = INFO
logfile = C:\Somewhere\enhydris_cache.log
cache_dir = C:\Somewhere\EnhydrisCache

base_url = https://openmeteo.org/
id = 6539
file = ntua.hts

base_url = https://openmeteo.org/
id = 9356
file = C:\SomewhereElse\nedontas.hts

base_url = https://upatras.gr/enhydris/
user = george
password = topsecret
id = 8765
file = arta.hts

With the above configuration file, enhydris_cache will log information in the file specified by logfile. It will download time series from Enhydris and store them in the specified files; these can be absolute or relative pathnames; if they are relative, they will be stored in the directory specified by cache_dir. In this example, the local files will be C:\Somewhere\ntua.hts, C:\SomewhereElse\nedontas.hts, and C:\Somewhere\arta.hts.


The configuration file has the format of INI files. There is a [General] section with general parameters, and any number of other sections, which we will call “time series sections”, each time series section referring to one time series.

General parameters


Optional. Can have the values ERROR, WARNING, INFO, DEBUG. The default is WARNING.


Optional. The full pathname of a log file. If unspecified, log messages will go to the standard error.


Optional. enhydris_cache will change directory to this directory, so any relative filenames will be relative to this directory. If unspecified, relative filenames will be relative to the directory from which enhydris_cache was started.

Time series sections

The name of the section is ignored.


The base URL of the Enhydris installation that hosts the time series. Most often the base_url will be the same for all time series, but in the general case you might want to get data from many Enhydris installations.


The id of the time series.


Optional. Needed if that Enhydris installation needs login in order to provide access to the data.


The filename of the file to which the data will be cached. See also cache_dir.