armannvg


Software developer, working mainly in C++, Python, and C#


numconv.com

The numconv Python script was originally thought for developers that had Python already set up and ready to go. However, this might not always be the case and sometimes people need to do these kind of number conversions without having any interest in going through the trouble of configuring Python on their machine.

In order to accommodate these users I decided to create the numconv.com website that offers similar functionality as the original Python script. The only difference is that the website cannot convert to and from ip addresses. This is because the ipaddress class used in the script is only supported in Python 3.3 but the Google App Engine that is used to host the website requires Python 2.7.

The codebase was changed almost entirely and only the actual conversion methods are the same. The command line option parsing was thrown out, obviously, and replaced by code that is handling web requests with Flask. The HTML is rendered using Mako templates, Bootstrap was used for styling purposes, and jquery for the UI behavior. Overall, the code is relatively straightforward and the website was put together pretty quickly. Making it a no-brainer to provide this functionality to users that want to do all their number conversions in the same place.

This website itself is extremely simple, the user enters a number in the textbox and selects which type of number he has in the combobox. Then the "Convert !" button will send a request to the server which does the number conversions and writes them down in a table below. If there are any errors then that will be written in red between the user input controls and the conversion table.

There is one small feature that needs to be mentioned. The conversion parameters are added to the query string when the user presses the "Convert !" button. This means it's possible to create a link that will open numconv.com with some specific conversion externally e.g. to convert 113, XVII, and 0x4458

That's all folks, any comments and suggestions are welcome and can be sent to numconv@numconv.com