planningalerts morph.io data layer Python client package
Aims to provide a simple, standardised perisistance layer for PlanningAlerts records.
Mainly intended to use when writing PlanningAlerts scrapers on morph.io. Morph python environments already have nice libraries, like scraperwiki installed, but those don’t enforce the data requirements expected by PlanningAlerts. This library attempts to do so.
python setup.py install
pip install morph_planningalerts
from morph_planningalerts import DevelopmentApplication, MorphDatabase # Make sure the database file exists. If it does, this won't do anything. MorphDatabase.init() # Time passes... data is scraped... new_record = DevelopmentApplication.create( council_reference='M123/456', address='64 Zoo Lane', description='this is the least info needed to prevent explosions', info_url='http://detail_page_about_application', comment_url='http://some_feedback_url' ) # Or, if you only want to insert new records: record, was_created = DevelopmentApplication.create_or_get( council_reference=... )
For more examples, check out the docs on querying with the Peewee ORM.
You can get the code here: