Python "akips" module
Anyone working in Python and wanting to use the AKiPS API might find the "akips" module (https://pypi.org/project/akips/) helpful. This is a basic python wrapper to handle standard operations and process results into a standard format. It basically makes using the API faster than starting from scratch.
After several in-house development projects, maintaining business logic specific to our environment, we decided to publish a general module for ease of use. The code repo is published on github (https://github.com/unc-network/akips) and is open for feedback or suggestions.
Comments
2 comments
Great! I've written some library stuff as well. Will have a look at what you've done.
Russell
Following up on this — 1.0.0 is on PyPI now.
It covers a lot more of the API than it did: availability statistics, UPS power and battery state, syslog and traps, and a generic call() that reaches any section for the things it doesn't wrap. Everything is type annotated and the package ships py.typed, so editors and type checkers can see what comes back instead of guessing.
It also handles both API accounts. Give the client the api-ro and api-rw passwords and each call authenticates as whichever one its section needs, rather than building two clients and remembering which is which.
Worth flagging that it is a breaking release. Return shapes that disagreed with each other are settled and a few methods changed how they are called, so anyone on 0.x should read MIGRATING.md before upgrading — it has before and after for each change.
Developed and tested against 26.5, and every pre-release was exercised against a fleet of around 17,000 devices by an application we run in-house, which is where most of the fixes came from. Still open to feedback or issues on the repo.
https://github.com/unc-network/akips
Please sign in to leave a comment.