python-based solution