planningalerts morph.io data layer Python client package
Project description
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.
Installation
From source
python setup.py install
pip
pip install morph_planningalerts
Usage
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.
Source code
You can get the code here:
Testing
tox is being used to run the tests across python 2.7 & 3.x.
To bootstrap your test environment, the easiest way is you use the pip requirements file:
pip install -r requirements.txt
Then you can simply run:
tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file morph_planningalerts-1.0.1.tar.gz
.
File metadata
- Download URL: morph_planningalerts-1.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48353ad567b8898a0912d5840c5be7fcd23c31c2f1e5383880b73714a03f84cb |
|
MD5 | 6f6cf376a5cbbedf16534e92f8e84115 |
|
BLAKE2b-256 | 305c6b455fa6fbfa0489144fad329eb68436b9ed8ce6a2bacee063f810e78828 |