WOFpy is a Python package that implements CUAHSI's WaterOneFlow Web service. WaterOneFlow is a Web service with methods for querying time series of water data at point locations, and which returns data in WaterML format, providing standardized access to water data.
WOFpy reads data from a Data Access Object (DAO) and translates the data into WaterML.
DAOs can represent a variety of data sources, including databases,
text files, and Web sites or services.
view example DAOs in the examples folder,
or write your own based on the BaseDao class in
WOFpy uses Python version 2.7.
WOFpy documentation is currently (2017 August-September) being overhauled. Much of the previous documentation available at http://pythonhosted.org/WOFpy is out of date and should be used with care, mainly for conceptual descriptions.
See this interim document for up-to-date, detailed installation and configuration instructions. Configuration examples are based on ODM2 timeseries and measurements DAO's.
ODM2 and ODM1 Instructions
Note: These materials may be out of date.
Running the Examples
Example services are included with WOFpy. Each example consists of data, Data Access Objects (DAOs), models, and the service definition. The examples are located in the examples folder. See the documentation for more information.
A quick way to use the examples is via the
wofpy_config --help to display the usage Instructions.
The command above will create and populate the
MyWorkingDirectory with the files needed to run the
odm2 timeseries example.
Right now there is only one tested example,
in the future extra options will enable the user to choose the base example used.
Publishing Your Data
Follow the general steps below to publish your data with WOFpy.
- Write a new DAO class based on wof.dao.BaseDao; the methods should return objects as defined in wof.models. This class helps WOFpy read your data.
- Write a new config file like those found in the examples,
wof/examples/flask/odm2/timeseries/odm2_config_timeseries.cfg. This file contains static descriptors of your Web service such as the name of your water observations network.
- Write a new runserver script to use the new DAO you implemented. See files named runserver_*.py in the examples folder for examples.
- To test, open a command window, navigate where your runserver file is located, and use Python to run the script, e.g., python runserver.py.
WOFpy was originally developed and maintained (2011-2012) by the Texas Water Development Board. Stewardship and continued development was taken up in 2015 by a multi-institution team associated with the ODM2 and BiG-CZ projects, with support from National Science Foundation Grant ACI-1339834.
Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.