|
| 1 | +nut2 |
| 2 | +==== |
| 3 | + |
| 4 | +.. image:: https://travis-ci.org/rshipp/python-nut2.svg?branch=master |
| 5 | + :target: https://travis-ci.org/rshipp/python-nut2 |
| 6 | + :alt: Build Status |
| 7 | +.. image:: https://coveralls.io/repos/rshipp/python-nut2/badge.png?branch=master |
| 8 | + :target: https://coveralls.io/r/rshipp/python-nut2?branch=master |
| 9 | + :alt: Test Coverage |
| 10 | +.. image:: https://api.codacy.com/project/badge/Grade/741acf61ed264ba3aac7dcf33c55a40f |
| 11 | + :target: https://www.codacy.com/app/rshipp/python-nut2 |
| 12 | + :alt: Code Health |
| 13 | +.. image:: http://img.shields.io/pypi/v/nut2.svg |
| 14 | + :target: https://pypi.python.org/pypi/nut2 |
| 15 | + :alt: PyPi Version |
| 16 | + |
| 17 | +This is an API overhaul of PyNUT_, a Python library to allow communication with NUT |
| 18 | +(`Network UPS Tools`_) servers. |
| 19 | + |
| 20 | +**Note**: This is an unofficial project, and is in no way supported or |
| 21 | +endorsed by the `Network UPS Tools developers`_. |
| 22 | + |
| 23 | +Requirements |
| 24 | +------------ |
| 25 | + |
| 26 | +The module itself requires only Python (known to work with versions 2.6 through |
| 27 | +3.4). If you wish to run the tests, do ``pip install -r requirements-testing.txt``. |
| 28 | + |
| 29 | +Usage |
| 30 | +----- |
| 31 | + |
| 32 | +Example:: |
| 33 | + |
| 34 | + from nut2 import PyNUTClient |
| 35 | + client = PyNUTClient() |
| 36 | + client.help() |
| 37 | + client.list_ups() |
| 38 | + client.list_vars("My_UPS") |
| 39 | + |
| 40 | +Please note that this module has completely and intentionally broken |
| 41 | +backwards compatibility with PyNUT 1.X. |
| 42 | + |
| 43 | +See inline documentation for more usage information. |
| 44 | + |
| 45 | +Installation |
| 46 | +------------ |
| 47 | + |
| 48 | +Just use pip:: |
| 49 | + |
| 50 | + pip install nut2 |
| 51 | + |
| 52 | +PyNUT |
| 53 | +----- |
| 54 | + |
| 55 | +The following information is copied from the original PyNUT README: |
| 56 | + |
| 57 | + This directory contains various NUT Client related Python scripts, written by |
| 58 | + David Goncalves, and released under GPL v3. |
| 59 | + |
| 60 | + * "module": this directory contains PyNUT.py, which is a Python abstraction |
| 61 | + class to access NUT server(s). You can use it in Python programs to access NUT's |
| 62 | + upsd data server in a simple way, without having to know the NUT protocol. |
| 63 | + |
| 64 | + To import it on Python programs you have to use the following (case sensitive) : |
| 65 | + 'import PyNUT' |
| 66 | + |
| 67 | + This module provides a 'PyNUTClient' class that can be used to connect and get |
| 68 | + data from an upsd data server. |
| 69 | + |
| 70 | + To install the PyNUT module on Debian/Ubuntu, copy it to: |
| 71 | + /usr/share/python-support/python-pynut/ |
| 72 | + |
| 73 | + This directory also contains test_nutclient.py, which is a PyNUT test program. |
| 74 | + For this to be fully functional, you will need to adapt the login, password and |
| 75 | + upsname to fit your configuration. |
| 76 | + |
| 77 | + |
| 78 | +.. _PyNUT: https://github.com/networkupstools/nut/tree/master/scripts/python |
| 79 | +.. _Network UPS Tools: http://www.networkupstools.org/ |
| 80 | +.. _Network UPS Tools developers: https://github.com/networkupstools |
0 commit comments