I don't think is a good idea nesting access to database *and* to PyPLN API here. For me, this module should only deal with PyPLN API and the script `load_into_pypln.py` should be responsible for accessing the database and should use this module to send to PyPLN.