Skip to main content

nut2

Test Coverage Code Health PyPi Version

Project Origin and Python 3.13 Support

This repository is based on the original python-nut2 project by Ryan Shipp: https://github.com/rshipp/python-nut2

We have extended the project to add support for Python 3.13, as the standard library’s telnetlib is deprecated. The package now uses telnetlib3 for telnet communication.

Nut2

This is an API overhaul of PyNUT, a Python library to allow communication with NUT (Network UPS Tools) servers.

Note: This is an unofficial project, and is in no way supported or endorsed by the Network UPS Tools developers.

Requirements

The module itself requires only Python (2.7 or 3.5+). If you wish to run the tests, do pip install -r requirements-testing.txt.

Usage

Example:

from nut2 import PyNUTClient
client = PyNUTClient()
client.help()
client.list_ups()
client.list_vars("My_UPS")

Please note that this module has completely and intentionally broken backwards compatibility with PyNUT 1.X.

See inline documentation for more usage information.

Installation

Just use pip:

pip install nut2

PyNUT

The following information is copied from the original PyNUT README:

This directory contains various NUT Client related Python scripts, written by David Goncalves, and released under GPL v3.

  • “module”: this directory contains PyNUT.py, which is a Python abstraction class to access NUT server(s). You can use it in Python programs to access NUT’s upsd data server in a simple way, without having to know the NUT protocol.

To import it on Python programs you have to use the following (case sensitive) : ‘import PyNUT’

This module provides a ‘PyNUTClient’ class that can be used to connect and get data from an upsd data server.

To install the PyNUT module on Debian/Ubuntu, copy it to: /usr/share/python-support/python-pynut/

This directory also contains test_nutclient.py, which is a PyNUT test program. For this to be fully functional, you will need to adapt the login, password and upsname to fit your configuration.

Development

Install pre-commit hooks defined by .pre-commit-config.yaml

pip3 install -U pre-commit
pre-commit install

Auto fix

pre-commit run --all-files

Plugin version update

pre-commit autoupdate

Metadata

Release files for ph4-nut2 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ph4-nut2 3.1.0
File Size Uploaded
ph4_nut2-3.1.0.tar.gz 26.5 kB Details

Release files / ph4_nut2-3.1.0.tar.gz

Download URL ph4_nut2-3.1.0.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9e73a090c7fd6903e0943259e4daed88172f6fe2d0a583fc215daca1a24fc366
BLAKE2b-256 checksum
How to use checksums
5916744ec1a82df5068ff14f25310f7e81105eb91276533997be91bbdd8370cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

3.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page