Local filesystem cache of data from an Enhydris server¶
enhydris_cache [--traceback] config_file
DESCRIPTION AND QUICK START¶
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.
How to run it¶
First, you need to create a configuration file with a text editor such
notepad, or whatever. Create such a file
and name it, for example,
/var/tmp/enhydris_cache.conf, or, on
Windows, something like
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:
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
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:
[General] loglevel = INFO logfile = C:\Somewhere\enhydris_cache.log cache_dir = C:\Somewhere\EnhydrisCache [ntua] base_url = https://openmeteo.org/ id = 6539 file = ntua.hts [nedontas] base_url = https://openmeteo.org/ id = 9356 file = C:\SomewhereElse\nedontas.hts [arta] 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
CONFIGURATION FILE REFERENCE¶
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.
Optional. Can have the values
DEBUG. The default is
Optional. The full pathname of a log file. If unspecified, log messages will go to the standard error.
enhydris_cachewill 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
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_urlwill 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.