python library implementation