You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer: This is more of a feature request/ product vision then a concrete action.
The fritzconnection project does a great job to provide a simple API to Fritzboxes as well as some CLI tools. I think it would be a good way forward to simplify the usage of the project as a CLI since this lowers the usage barriers.
Currently users are required to have Python environment available in which they call pip install .... In contrast, to just execute the CLI functionality, core Python comes with the zipapp package. My suggestion is to provide the user with a a self contained Python archive which just needs a recent Python interpreter to execute. To execute an imaginary fritzconnection CLI a user might just call python fritzconnection.pyz. This self-contained approach is very similar to Java fat jars which execute like java -jar myapp.jar.
The platform independent packaging via zipapp already seems to work. Here is what I did on my Windows 11 machine inside WSL 2:
This worked straight away. Also setting the password via ENV variable and running python3 /mnt/c/temp/app.pyz -i 192.168.178.1 worked. Additionally I ran the same app.pyz in the Windows 11 context and it also worked without any modifications. So the chances are quite high that the produced app archive is truly platform independent and also works e.g. on Macs.
So in my eyes there is only little to do to provide a zipapp which is platform agnostic and can be much simpler used - just download the file and execute (Python3 provided). What is left to do here would be the CI setup to build + release the app archive.
Which brings me to the next improvement. Currently, fritzconnection comes with a bunch of simple CLI tools which can be found inside the cli directory. For a zipapp a single entry point/ CLI command would be needed. To differentiate the functionalities the CLI would work with subcommands like python fritzconnection.pyz phonebook or python fritzconnection.pyz status. For this task a dedicated framework like click is probably a good choice (the functionality of plain argparse is limited)
Disclaimer: This is more of a feature request/ product vision then a concrete action.
The fritzconnection project does a great job to provide a simple API to Fritzboxes as well as some CLI tools. I think it would be a good way forward to simplify the usage of the project as a CLI since this lowers the usage barriers.
Currently users are required to have Python environment available in which they call
pip install ...
. In contrast, to just execute the CLI functionality, core Python comes with thezipapp
package. My suggestion is to provide the user with a a self contained Python archive which just needs a recent Python interpreter to execute. To execute an imaginary fritzconnection CLI a user might just callpython fritzconnection.pyz
. This self-contained approach is very similar to Java fat jars which execute likejava -jar myapp.jar
.The platform independent packaging via
zipapp
already seems to work. Here is what I did on my Windows 11 machine inside WSL 2:This worked straight away. Also setting the password via ENV variable and running
python3 /mnt/c/temp/app.pyz -i 192.168.178.1
worked. Additionally I ran the sameapp.pyz
in the Windows 11 context and it also worked without any modifications. So the chances are quite high that the produced app archive is truly platform independent and also works e.g. on Macs.So in my eyes there is only little to do to provide a zipapp which is platform agnostic and can be much simpler used - just download the file and execute (Python3 provided). What is left to do here would be the CI setup to build + release the app archive.
Which brings me to the next improvement. Currently, fritzconnection comes with a bunch of simple CLI tools which can be found inside the
cli
directory. For a zipapp a single entry point/ CLI command would be needed. To differentiate the functionalities the CLI would work with subcommands likepython fritzconnection.pyz phonebook
orpython fritzconnection.pyz status
. For this task a dedicated framework like click is probably a good choice (the functionality of plainargparse
is limited)An inspiration could be the meanwhile archived fritzctl project: https://github.com/bpicode/fritzctl
The text was updated successfully, but these errors were encountered: