planningalerts morph.io数据层python客户端包
morph_planningalerts的Python项目详细描述
旨在为PlanningAlerts记录提供一个简单、标准化的电阻层。
主要用于在morph.io上编写planningalerts scrapers时使用。变形python环境 安装了很好的库,比如scraperwiki,但是这些库没有强制数据requirements 计划警报需要。这个图书馆试图这样做。
安装
来源
python setup.py install
PIP
pip install morph_planningalerts
用法
frommorph_planningalertsimportDevelopmentApplication,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=...)
有关更多示例,请查看querying with the Peewee ORM上的文档。