The list of other software that pywws depends on looks frighteningly long at first glance. However, many of these packages won’t be needed by most users. What you need depends on what you want to do with pywws. Remember, it’s a “kit of parts” rather than a monolithic application.
Some of the requirements are Python packages that can be downloaded from the Python Package Index (PyPI). I recommend using pip to install these.
You should be able to install the remaining dependencies using your operating system’s package manager. This is a lot easier than downloading and compiling source files from the project websites. Note that some Linux distributions use different names for some of the packages, e.g. in Ubuntu, pyusb is called python-usb.
Note: some of these libraries may have their own dependencies that you may need to install. Follow the links to read more about each library’s requirements.
- Python version 2.7 or higher, preferably Python 3
If you are stuck on Python 2.5 or 2.6 for some reason you can use the older “legacy” branch of pywws. This will not be further developed so you’ll be missing out on any improvements made to the main branch.
You will probably be able to install pip with your system’s package manager, where it may be called python-pip or python3-pip or something similar.
If not, download and run the
get-pip.py file from the pip web site.
In either case you should immediately use pip to install the latest version of itself:
sudo pip install --upgrade pip
Make sure you install the correct Python version’s pip. If you want to install pywws for both Python 2 and Python 3 you will need pip2 and pip3.
This is a handy little module that provides information on your local time zone.
It’s best installed with
sudo pip install tzlocal
To retrieve data from a weather station pywws needs a python library that allows it to communicate via USB. There is a variety of USB libraries that can be used. Not all of them are available on all computing platforms, which may restrict your choice.
Mac OS X¶
On MacOS X the operating system’s generic hid driver “claims” the weather station, which makes it very difficult to use any other USB interface. Unfortunately, you will need to download and compile hidapi yourself.
If you can’t install ctypes then you can try the Cython interface to hidapi instead:
- cython (your package manager may know it as python-Cython)
Other systems use a Python interface to the libusb system library. There is a choice of interface and library version - install the latest that is available for your computer.
- libusb version 1.x (should be available from the package manager)
- python-libusb1 version 1.3+
pip install libusb1
pip install pyusb
If neither of these options works for you then you may be able to use hidapi – see the Mac OS X instructions above.
Changed in version 15.01.0.dev1265: added ability to use python-libusb1 interface.
Flexible timed tasks¶
pywws.regulartasks module can do tasks at particular times and/or dates.
This requires the croniter library.
(Simple hourly, daily or ‘live’ tasks don’t need this library.)
pip install croniter
Running as a daemon¶
pywws.livelogdaemon module runs pywws live logging as a proper UNIX daemon process.
It requires the python-daemon library:
pip install python-daemon
pywws.plot module uses gnuplot to draw graphs.
If you want to produce graphs of weather data, e.g. to include in a web page, you need to install the gnuplot application:
- gnuplot v4.2 or higher (should be available from the package manager)
After installing gnuplot you should edit weather.ini (see weather.ini - configuration file format) and set the
gnuplot version config item.
Finding out the installed gnuplot version is easy:
Weather “service” uploading¶
Uploading to HTTP based “services” such as Weather Underground requires the Python requests library:
pip install requests
Secure website uploading (sftp)¶
pywws.towebsite module can use “ftp over ssh” (sftp) to upload files to your web-site.
Normal uploading just uses Python’s standard modules, but if you want to use sftp you need to install these two modules:
sudo pip install pycrypto paramiko
pywws.service.twitter module can be used to send weather status messages to Twitter.
Posting to Twitter requires these modules:
- python-twitter v3.0 or higher
sudo pip install python-twitter oauth2
- tweepy v2.0 or higher
sudo pip install tweepy oauth2
tweepy appears to be the less reliable of the two.
If you have problems, e.g. with character encoding, try installing
New in version 14.12.0.dev1260.
pywws.service.mqtt module can be used to send weather data to an MQTT broker.
This requires the paho-mqtt module:
sudo pip install paho-mqtt
To create new language translations¶
pywws can be configured to use languages other than English, as described in How to use pywws in another language. The Babel package is required to extract the strings to be translated and to compile the translation files.
sudo pip install babel
Copying files to or from Transifex requires the transifex-client package.
sudo pip install transifex
Translating the documentation using local files needs the sphinx-intl package.
sudo pip install sphinx-intl
Changed in version 14.05.dev1209: pywws previously used the gettext package.
To ‘compile’ the documentation¶
The documentation of pywws is written in “ReStructured text”. A program called Sphinx is used to convert this easy to write format into HTML for use with a web browser. If you’d like to create a local copy of the documentation (so you don’t have to rely on the online version, or to test a translation you’re working on) you need to install Sphinx, version 1.3 or later.
sudo pip install sphinx
Comments or questions? Please subscribe to the pywws mailing list http://groups.google.com/group/pywws and let us know.