Code Monkey home page Code Monkey logo

adderlib's Introduction

adderlib

adderlib is an unofficial python implementation of the Adder API, for use with Adderlink KVM systems.

With adderlib, you can:

  • Log in or out as an existing KVM user
  • Query lists of transmitters, receivers, and channels available to the user
  • Access many properties of the KVM devices
  • Connect receivers to channels
  • Manage presets

...and so much more! Well, a little bit more.

Getting Started

The best way to get started is to check out the examples, and then the official documentation on ReadTheDocs. But in general, it's four easy steps:

from adderlib import adder

# Step 1: Create a handle to the API by passing the IP address or hostname of the AIM (the KVM server)
api = adder.AdderAPI("192.168.1.10")

# Step 2: Log in using an exising KVM account
api.login("username","password")

# Step 3: Do some stuff
for tx in api.getTransmitters():
  do_some_stuff(tx)
  
# Step 4: Don't forget to log out!
api.logout()

Customizable

Boy oh boy is this customizable! An UrlHandler abstract class is provided. Subclass this and override the api_call() method to communicate with the server however you wish! I sure spent a lot of time on the default RequestsHandler class, which uses the requests library but that's ok I'm sure you have your reasons.

adderlib's People

Contributors

mjiggidy avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

eriko-de

adderlib's Issues

Some dependency issues

Hey, first of all many thanks for this awesome libary :)

I used it to test and play around with some adderlib devices on a network running a script on a raspberry pi.

When I was using it, I found two minor issues related to dependencies and runtimes:

  1. The 'xmltodict' libary needs to be forced to be <0.13, I'm not an export in python programming, but it seems the version requirement is set in the requirements.txt, when setting up this project, but when installing adderlib via pip, it seems to use the latest version.
  2. When using default python on raspberry pi (version 3.7), you get an error message:
Traceback (most recent call last):
  File "/usr/local/bin/kvm_switcher.py", line 3, in <module>
    from adderlib import adder
  File "/usr/local/lib/python3.7/dist-packages/adderlib/adder.py", line 13, in <module>
    class AdderAPI:
  File "/usr/local/lib/python3.7/dist-packages/adderlib/adder.py", line 257, in AdderAPI
    group_name:typing.Optional[str]=None) -> AdderChannel:
TypeError: 'type' object is not subscriptable

I needed to compile the latest python version (3.10.5 at that time) to have it work.

This is my first python project so maybe there is an easier solution for the issues. Just wanted to share my experiences

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.