evamaxfield / pywslegislature

Python wrapper around Washington State Legislative Web Services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pywslegislature

Request wrappers around Washington State Legislative Web Services API

Quickstart

Specific WSL Web Services Handler:

from pywslegislature import Biennium, WSLRequest, services
from pywslegislature.services import CommitteeService

print(CommitteeService.header)
# 'CommitteeService.asmx'

print(CommitteeService.source)
# 'http://wslwebservices.leg.wa.gov/CommitteeService.asmx'

request = WSLRequest(CommitteeService.header, CommitteeService.GetCommittees, {"biennium": str(Biennium(2013))})
print(request)
# <WSLRequest [http://wslwebservices.leg.wa.gov/CommitteeService.asmx/GetCommittees?biennium=2013-14]>

results = request.process()
print(results)
# <WSLResults [http://wslwebservices.leg.wa.gov/CommitteeService.asmx/GetCommittees?biennium=2013-14]>

# Results are available as xml.etree.ElementTree or collections.OrderedDict
print(results.xml)
# ...
print(results.json)
# ...

In progress

ORM style mappings between Legilature objects:

Get the most up-to-date Washington State Legislature details:

from pywslegislature import Legislature

current = Legislature()
print(current.committees[0])
# <Committee [17366 Appropriations House APP]>

Get a specific Washington State Legislature details:

from pywslegislature import Biennium, Legislature

specific = Legislature(Biennium(2013))
print(current.committees[0])
# <Committee [8221 Agriculture & Natural Resources House AGNR]>

Credits

This package was created with Cookiecutter.

About

Python wrapper around Washington State Legislative Web Services

License:MIT License


Languages

Language:Python 95.4%Language:Makefile 4.6%