Dipendenze

La lista di altri software da cui dipende pywws sembra spaventosamente lunga a prima vista. Tuttavia, molti di questi pacchetti non sono necessari nella maggior parte degli utenti. Che cosa avete bisogno dipende da cosa si vuole fare con pywws. Ricordate, è un «kit of parts» piuttosto che un’applicazione monolitica.

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.

Nota: alcune di queste librerie possono avere le loro proprie dipendenze che potrebbe essere necessario installare. Segui i link per saperne di più su ciascuna libreria.

Indispensabile

  • Python version 2.5 or higher

Python 3 è supportato, ma alcune cose potrebbero non funzionare correttamente. Se avete un problema con Python 3, si prega di inviare un messaggio al mailing list o presentare un <https://github.com/jim-easterbrook/pywws/issues>`_.

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 pip:

sudo pip install tzlocal

Libreria USB

Per recuperare dati da una stazione meteo pywws ha bisogno di una libreria che permette di comunicare via USB. C’è una varietà di librerie USB che possono essere utilizzate. Non tutte sono disponibili su tutte le piattaforme informatiche, che possono limitare la vostra scelta.

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.

  • hidapi
  • ctypes (your package manager may know it as python-ctypes)

If you can’t install ctypes then you can try the Cython interface to hidapi instead:

Other systems

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.

pip install libusb1

or

  • libusb version 1.x or version 0.1 (should be available from the package manager)
  • PyUSB version 1.0
pip install pyusb --pre

The --pre flag enables the installation of «pre release» versions, such as the current beta release (1.0.0b2) of pyusb.

If neither of these options works for you then you can use hidapi – see the Mac OS X instructions above.

Cambiato nella versione 15.01.0.dev1265: added ability to use python-libusb1 interface.

Flexible timed tasks

The pywws.Tasks 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

The pywws.livelogdaemon program runs pywws live logging as a proper UNIX daemon process. It requires the python-daemon library:

pip install python-daemon

Disegnare grafici

The 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 - configurazione del formato del file) and set the gnuplot version config item. Finding out the installed gnuplot version is easy:

gnuplot -V

Trasferimento sicuro di file (sftp)

Il modulo pywws.Upload può utilizzare «ftp over ssh» (sftp) per caricare i file sul vostro sito web. Il caricamento normale utilizza i moduli Python standard, ma se si desidera utilizzare sftp è necessario installare questi due moduli:

sudo pip install pycrypto paramiko

Postare su Twitter

Il modulo pywws.ToTwitter è utilizzato per inviare messaggi delle condizioni meteo a Twitter. Per postare su Twitter richiede questi moduli:

sudo pip install python-twitter oauth2

or

sudo pip install tweepy oauth2

Note that tweepy appears to be the less reliable of the two. If you have problems, e.g. with character encoding, try installing python-twitter instead.

Cambiato nella versione 13.10_r1086: Riabilitato uso della libreria tweepy come un’alternativa a python-twitter. python-oauth2 è ancora richiesto da pywws.TwitterAuth.

Cambiato nella versione 13.06_r1023: Pywws precedentemente utilizzava la libreria tweepy invece di python-twitter e python-oauth2.

MQTT

Nuovo nella versione 14.12.0.dev1260.

The pywws.toservice module can be used to send weather data to an MQTT broker. This requires the paho-mqtt module:

sudo pip install paho-mqtt

Per creare nuove traduzioni di lingua

pywws can be configured to use languages other than English, as described in Come utilizzare pywws in un altra lingua. 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-client

Translating the documentation using local files needs the sphinx-intl package.

sudo pip install sphinx-intl

Cambiato nella versione 14.05.dev1209: pywws previously used the gettext package.

Per “compilare” la documentazione

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

Commenti o domande? È possibile iscriversi alla mailing list pywws http://groups.google.com/group/pywws e farci sapere.