Skip to main content

A simple package to control PDUs

Project description

pducontrol

pducontrol is a Python library to control a wide variety of PDUs Currently we support the following models:

  • SWH-1023J-08N1 (Dexlan, seems to be just an OEM rebadged unit)
  • PDU81003 (CyberPower)

Installation

You can install pducontrol from source:

make pip
pip install /dist/pducontrol-*.tar.gz

or just call the refresh_package.sh script

Usage

This package provides both Python and CLI interfaces, here is how you can use them:

In Python

from pducontrol import PDUControlREST
pdu = PDUControlREST("192.168.0.23")
print(pdu.get_all_names())

In CLI

pducontrol 192.168.0.23 get_name all

A configuration file named pdu_settings.cfg, containing IP addresses and credentials can be added in~/.config/pducontrol/ for ease of use and autocompletion.

An example file is available in config.

Contributing

Bug reports and comments are warmly welcome, but contributions, such as pull requests and patches, are not, for legal reasons only. If that's bothering you, don't hesitate to tell, with enough pressure, we could reconsider our position.

License

pducontrol is released under LGPL v3

Hacking

Execute the program from the source directory

python3 -m pducontrol

Generate a debian package

make debian

Execute the unit tests

They are located in tests/.

make test

Coding style

All python files should respect the PEP 8 coding style and shell scripts, the shellcheck coding style.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pducontrol-1.4.0.tar.gz (26.9 kB view details)

Uploaded Source

File details

Details for the file pducontrol-1.4.0.tar.gz.

File metadata

  • Download URL: pducontrol-1.4.0.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.66.4 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for pducontrol-1.4.0.tar.gz
Algorithm Hash digest
SHA256 c5e5ec77233c41fcbf7ad453b89b4dcffcaf10c4cea5e066aaf48ba01caa71ba
MD5 43463a868a70cca7da16899f1b46aba4
BLAKE2b-256 c010eefe3044ea760731a8aecf377231b7ac07c1b3a0570a46288915b9433f42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page