Once I began a library, you may find it in the compat branch of PWB as apispec.py. The purpose was to create an API-based library to the special pages.
Currently there is nothing in it for blocking but for checking blocks there is. Feel free to continue if you want!