domingo, 6 de março de 2016

Searching dd-wrt Router Database with ddwrtdb

I really like the dd-wrt router operating system: I can install it on cheap routers (starting from 27 USD, as TP-Link WR741ND) to have a great Web configuration interface and performance (way better than general factory software).

I'm always looking for new router models to check if they're supported by dd-wrt and to compare prices/hardware specs (as I'm always buying new routers to help some friends with their Wi-Fi networks). The problem is: dd-wrt's website usability is not that good, specially the router database search. As I prefer to use my terminal instead of the Web browser, I've created a command-line tool to deal with it: it's called ddwrtdb and the code is available at my GitHub account!

It's also available on Python Package Index so you can install it using Python's pip by running:

pip install https://github.com/turicas/rows/archive/develop.zip
pip install ddwrtdb

That's it! Now run ddwrtdb --help to see the available commands (it's pretty intuitive). You can also check out the project' README for command examples.

This simple command-line tool (< 200 lines of Python code) was created using these awesome libraries:

  • click, to easily create a beautiful command-line interface;
  • lxml, to use XPath in order to parse HTML more easily;
  • requests, to make HTTP requests to dd-wrt's website;
  • rows, to automatically extract tables from HTML and to export data to any tabular format.

Nenhum comentário:

Postar um comentário