This repository contains Python scripts for converting colors between different formats. It is similar to code used by ColorWiki.
There is indeed a Python library for doing this, but it might be useful to understand the algorithm behind color conversion.