Skip to main content

A Python 3 API for Tripp Lite's TLNETCARD.

Project description

tlnetcard_python Build Status PyPI PyPI - License PyPI - Status

Welcome to tlnetcard_python! tlnetcard_python is a Python 3 API for the TLNET Supervisor web interface which is used with Tripp Lite's TLNETCARD, and aims to provide similar functionality in a scriptable format. This API makes frequent use of the requests_html module, and I strongly recommend you use it or its parent module requests in any projects which involve making HTML requests in Python. A second thank you goes to the people making the selenium module, of which this API makes intermittent use.

Installation Downloads PyPI - Python Version PyPI - Format

This package is installed using pip. If you do not have pip installed on your system, you can install it by downloading get-pip.py and running that python file (Windows/MacOS/Linux/BSD), or you can run the following command in terminal (Linux/BSD):

sudo apt install python3-pip

If you're using brew for MacOS, you can install pip (along with the rest of Python 3) using brew:

brew install python3

Note: The creator of this software does not recommend the installation of python or pip using brew, and instead recommends that pip be installed using get-pip.py, or that Python 3.6+ be installed using the installation candidates found on python.org, which include pip by default.

Using Pip to install from PyPi

Fetching this repository from PyPi is the recommended way to install this package. From your terminal, run the following command:

pip3 install tlnetcard-python

And that's it! Now you can go right ahead to the quick-start guide!

Using Pip to Install from Source

Installing this package from source is the only way to guarantee you're getting the latest, bleeding-edge code. If you're installing from source, I assume you already know the risks (stability is not guaranteed, stability is not guaranteed, etc.). Assuming you have git installed, installation from source can be accomplished easily (MacOS/Linux/BSD):

git clone https://github.com/EGuthrieWasTaken/tlnetcard_python.git
cd tlnetcard_python/
pip3 install .

If, for whatever reason, you have your heart set on not installing git on your system (who installs from source but won't use git?), you can also install by downloading the zip file for this project, unzipping it, and starting a terminal/cmd session in the unzipped directory. Then, run the following command (Windows/MacOS/Linux/BSD):

pip3 install .

And that's it! Now you can go right ahead to the quick-start guide!

Quick-Start Guide

After installation, you can get started with using the module immediately! You will first need to create a login object to initiate an authenticated session with TLNET Supervisor, and then you may run any other commands you wish, but understand that every action object must be initialized with the login session. An example is below:

import tlnetcard_python

# Creating authenticated session.
card = tlnetcard_python.Login("admin", "password", "10.0.0.100")

# Do whatever configuration is needed here.
batch_config = tlnetcard_python.system.administration.BatchConfiguration(card)
batch_config.upload_system_configuration("/home/sampleUser/sys_config.txt")

# Closing session.
card.logout()

Note that this process could be placed into a loop to configure multiple systems. Additionally, using the set_host() method allows for the same login object to be used with multiple hosts. The password will still need to be provided for each host change unless the save_passwd flag was set to True when the object was initialized. See example below:

from tlnetcard_python import Login
from tlnetcard_python.system.administration import BatchConfiguration
hosts = ['10.0.0.100', '10.0.0.101', '10.0.0.103', ...]

card = Login("admin", "password", save_passwd=True)
for host in hosts:
    card.set_host(host)
    batch_config = BatchConfiguration(card)
    batch_config.upload_system_configuration("/home/sampleUser/sys_config.txt")
card.logout()

Note: the creator(s) of this software will not be liable for any unintended results from using any tlnetcard_python software, including lost or stolen passwords. Please use options such as save_passwd with caution. For complete information regarding liability, see the License.

Documentation

Documentation for this project can be found in the GitHub Repository. Each folder has it's own documentation for the class files it contains. The documentation tree is below:

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

tlnetcard_python-0.2.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tlnetcard_python-0.2.2-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

Details for the file tlnetcard_python-0.2.2.tar.gz.

File metadata

  • Download URL: tlnetcard_python-0.2.2.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for tlnetcard_python-0.2.2.tar.gz
Algorithm Hash digest
SHA256 188902da14801b8ed7d41b49313bebc52e5e4c5a51fc45f45f8b78f91298f41e
MD5 0f5fbc33f9abfa19f0ed9b4bcf9685aa
BLAKE2b-256 778b4260d9b891e96a34e0506d50c77a361c3f665721d13378ed28a6b64b7e21

See more details on using hashes here.

File details

Details for the file tlnetcard_python-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: tlnetcard_python-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 52.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for tlnetcard_python-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 52e240b4f7ab1f02be88e463753689de42f4042e38179362477a1cccc4911a61
MD5 9b390f347e640379e22ff4d1a5d6247c
BLAKE2b-256 1b911043cbb28fadaa6ac1f770daedaf1c44043c8f00854215bcd2426ed32130

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