Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

probert94/python-swos-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-swos-lite

Python library to interact with MikroTik SwitchOS Lite

Caution

This library is deprecated and no longer maintained.
It has been replaced by python-switchos, which supports SwitchOS and SwitchOS Lite.

Features

  • Get identity, model, serial number, OS version, MAC and IP address

  • Read cpu temperature, current, voltage, and power consumption of the switch

  • List ports with name, status, speed, duplex mode etc.

  • Check PoE status, power usage, voltage, and current per port

Installation

Install via pip:

pip install python-swos-lite

Requires Python 3.10 or higher

Dependencies

  • demjson3 3.0.6 or higher - for tolerant JSON parsing

Usage Example

Example with httpx

async def main(host, user, password):
    auth = DigestAuth(user, password)
    async with AsyncClient(auth=auth) as session:
        client = Client(createHttpClient(session), host)
        print(await client.fetch(SystemEndpoint))

Example with aiohttp

async def main(host, user, password):
    digest_auth = DigestAuthMiddleware(login=user, password=password)
    async with ClientSession(middlewares=(digest_auth, )) as session:
        client = Client(createHttpClient(session), host)
        return await client.fetch(SystemEndpoint)

Supported Devices

This library targets MikroTik switches running SwitchOS Lite and has been tested with:

  • MikroTik CSS610-8P-2S+ running Switch OS Lite 2.19

Other models with SwitchOS Lite may also work.

License

MIT License

Contributing

Contributions are welcome!
Feel free to open issues, submit pull requests, or suggest features.

About

Python library to interact with MikroTik SwitchOS Lite

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages