omada-api


Nameomada-api JSON
Version 0.1.3 PyPI version JSON
download
home_page
SummaryA simple Python wrapper for the TP-Link Omada Software Controller API
upload_time2023-06-29 14:18:55
maintainer
docs_urlNone
authorIlja O
requires_python>=3.8,<4.0
licenseMIT
keywords tplink omada wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Omada API

A simple Python wrapper for the [TP-Link Omada Software Controller](https://www.tp-link.com/us/support/download/omada-software-controller/) API.

[![Tests](docs/badges/tests.svg)](docs/badges/tests.svg)
[![Coverage](docs/badges/coverage.svg)](docs/badges/coverage.svg)

[![Test Python versions](https://github.com/ghaberek/omada-api/actions/workflows/versions.yml/badge.svg)](https://github.com/ghaberek/omada-api/actions/workflows/versions.yml)

## Resources

Here are some links which may be helpful when using or extending this library:

- [Omada SDN Controller V5.9.9 API Document](https://community.tp-link.com/en/business/forum/topic/590430?replyId=1196216)
- [Omada SDN Controller V5.4.6 API Document](https://community.tp-link.com/en/business/forum/topic/590430?replyId=1196214)
- [Omada SDN Controller V5.0.15 API Document](https://community.tp-link.com/en/business/forum/topic/529298?replyId=1044808)
- [Omada SDN Controller V4.1.5 API Document](https://community.tp-link.com/en/business/forum/topic/253944?replyId=565824)
- [Requirements of Establishing an External Portal Server (> 5.0.15)](https://www.tp-link.com/us/support/faq/3231/)
- [Requirements of Establishing an External Portal Server (> 4.1.5)](https://www.tp-link.com/us/support/faq/2907/)
- [Requirements of Establishing an External Portal Server (> 2.6.0)](https://www.tp-link.com/us/support/faq/2274/)
- [Requirements of Establishing an External Portal Server (< 2.5.4)](https://www.tp-link.com/us/support/faq/928/)

## Usage

Currently this is just the bare-minimum required to log in, get site settings, push site settings, and log out.

```
from omada import Omada

# load our local config file
omada = Omada('omada.cfg')

# or specify the baseurl and site name directly
#omada = Omada(baseurl='https://...', site='Office')

# log into the controller (username and password are in omada.cfg)
omada.login()

# or specify the username and password directly
# omada.login(username='apiuser', password='secretpassword')

# get the site settings
settings = omada.getSiteSettings()

# turn the LEDs off
settings['led']['enable'] = False

# push the settings back
omada.setSiteSettings(settings)

# log out of the controller
omada.logout()
```

## Examples

### [led.py](led.py)

I use this in a cron schedule to turn my site LED setting off at night and back on in the morning.

Turn the LED on:

```
$ python led.py on
led: on
```
Turn the LED off:

```
$ python led.py off
led: off
```

### [clients.py](clients.py), [devices.py](devices.py)

These are simple apps to display similar output to the "Clients" and "Devices" page on the web interface.

```
$ python clients.py
USERNAME            IP ADDRESS      STATUS
00-11-22-33-44-55   192.168.1.123   CONNECTED
...
```

Make sure you have your [Settings](#Settings) file configured correctly for these to work.

## Settings

You can store your controller settings in a configuration file to avoid hard-coding them in your scripts.

Currently supported settings:

- `baseurl` - the base url to the controller
- `site` - the name of the site in the controller (usually `Default`)
- `verify` - set this to `False` to ignore self-signed certificate errors
- `warnings` - set this to `False` to hide urllib3 warnings when `verify=False`
- `verbose` - set this to `True` to force low-level reqeusts to output debugging info
- `username` - the username to log in as
- `password` - the password for the user

### Example

```
[omada]
baseurl = https://omadacontroller.local:8043
site = Default
verify = False
username = apiuser
password = secretpassword
```

## Acknowledgements

For my wife, who asked that I turn off the device LEDs at night. :heart:

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "omada-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "tplink,omada,wrapper",
    "author": "Ilja O",
    "author_email": "vrghost@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/47/61/2453ef6716bec40ded394b4d3a43e0dda20cdee6ec2f3117edab8163b2bd/omada_api-0.1.3.tar.gz",
    "platform": null,
    "description": "# Omada API\n\nA simple Python wrapper for the [TP-Link Omada Software Controller](https://www.tp-link.com/us/support/download/omada-software-controller/) API.\n\n[![Tests](docs/badges/tests.svg)](docs/badges/tests.svg)\n[![Coverage](docs/badges/coverage.svg)](docs/badges/coverage.svg)\n\n[![Test Python versions](https://github.com/ghaberek/omada-api/actions/workflows/versions.yml/badge.svg)](https://github.com/ghaberek/omada-api/actions/workflows/versions.yml)\n\n## Resources\n\nHere are some links which may be helpful when using or extending this library:\n\n- [Omada SDN Controller V5.9.9 API Document](https://community.tp-link.com/en/business/forum/topic/590430?replyId=1196216)\n- [Omada SDN Controller V5.4.6 API Document](https://community.tp-link.com/en/business/forum/topic/590430?replyId=1196214)\n- [Omada SDN Controller V5.0.15 API Document](https://community.tp-link.com/en/business/forum/topic/529298?replyId=1044808)\n- [Omada SDN Controller V4.1.5 API Document](https://community.tp-link.com/en/business/forum/topic/253944?replyId=565824)\n- [Requirements of Establishing an External Portal Server (> 5.0.15)](https://www.tp-link.com/us/support/faq/3231/)\n- [Requirements of Establishing an External Portal Server (> 4.1.5)](https://www.tp-link.com/us/support/faq/2907/)\n- [Requirements of Establishing an External Portal Server (> 2.6.0)](https://www.tp-link.com/us/support/faq/2274/)\n- [Requirements of Establishing an External Portal Server (< 2.5.4)](https://www.tp-link.com/us/support/faq/928/)\n\n## Usage\n\nCurrently this is just the bare-minimum required to log in, get site settings, push site settings, and log out.\n\n```\nfrom omada import Omada\n\n# load our local config file\nomada = Omada('omada.cfg')\n\n# or specify the baseurl and site name directly\n#omada = Omada(baseurl='https://...', site='Office')\n\n# log into the controller (username and password are in omada.cfg)\nomada.login()\n\n# or specify the username and password directly\n# omada.login(username='apiuser', password='secretpassword')\n\n# get the site settings\nsettings = omada.getSiteSettings()\n\n# turn the LEDs off\nsettings['led']['enable'] = False\n\n# push the settings back\nomada.setSiteSettings(settings)\n\n# log out of the controller\nomada.logout()\n```\n\n## Examples\n\n### [led.py](led.py)\n\nI use this in a cron schedule to turn my site LED setting off at night and back on in the morning.\n\nTurn the LED on:\n\n```\n$ python led.py on\nled: on\n```\nTurn the LED off:\n\n```\n$ python led.py off\nled: off\n```\n\n### [clients.py](clients.py), [devices.py](devices.py)\n\nThese are simple apps to display similar output to the \"Clients\" and \"Devices\" page on the web interface.\n\n```\n$ python clients.py\nUSERNAME            IP ADDRESS      STATUS\n00-11-22-33-44-55   192.168.1.123   CONNECTED\n...\n```\n\nMake sure you have your [Settings](#Settings) file configured correctly for these to work.\n\n## Settings\n\nYou can store your controller settings in a configuration file to avoid hard-coding them in your scripts.\n\nCurrently supported settings:\n\n- `baseurl` - the base url to the controller\n- `site` - the name of the site in the controller (usually `Default`)\n- `verify` - set this to `False` to ignore self-signed certificate errors\n- `warnings` - set this to `False` to hide urllib3 warnings when `verify=False`\n- `verbose` - set this to `True` to force low-level reqeusts to output debugging info\n- `username` - the username to log in as\n- `password` - the password for the user\n\n### Example\n\n```\n[omada]\nbaseurl = https://omadacontroller.local:8043\nsite = Default\nverify = False\nusername = apiuser\npassword = secretpassword\n```\n\n## Acknowledgements\n\nFor my wife, who asked that I turn off the device LEDs at night. :heart:\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple Python wrapper for the TP-Link Omada Software Controller API",
    "version": "0.1.3",
    "project_urls": {
        "Source": "https://github.com/vrghost/omada-api"
    },
    "split_keywords": [
        "tplink",
        "omada",
        "wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0e85921c58734add3b7d8e4468ceb556aeefabd9cca97deb054f21da1662c17a",
                "md5": "f1a42beb069c00b4923ca74ab81137ff",
                "sha256": "5a539c12b41559b14bb5b4af71987f03bc7972afde7b8eb0cd6e97f580c62838"
            },
            "downloads": -1,
            "filename": "omada_api-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f1a42beb069c00b4923ca74ab81137ff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 7937,
            "upload_time": "2023-06-29T14:18:53",
            "upload_time_iso_8601": "2023-06-29T14:18:53.859364Z",
            "url": "https://files.pythonhosted.org/packages/0e/85/921c58734add3b7d8e4468ceb556aeefabd9cca97deb054f21da1662c17a/omada_api-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47612453ef6716bec40ded394b4d3a43e0dda20cdee6ec2f3117edab8163b2bd",
                "md5": "5f55dc5ed23ef465d828a9dee8d39095",
                "sha256": "ec4c9be604e6dc591595d8e3f78c0f559c06b042a08c8304e65c2bb3a551a627"
            },
            "downloads": -1,
            "filename": "omada_api-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "5f55dc5ed23ef465d828a9dee8d39095",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 7456,
            "upload_time": "2023-06-29T14:18:55",
            "upload_time_iso_8601": "2023-06-29T14:18:55.072310Z",
            "url": "https://files.pythonhosted.org/packages/47/61/2453ef6716bec40ded394b4d3a43e0dda20cdee6ec2f3117edab8163b2bd/omada_api-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-29 14:18:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vrghost",
    "github_project": "omada-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "omada-api"
}
        
Elapsed time: 0.12025s