From bb030d1b932211ad0ec9c8abf84e206c891fbbaf Mon Sep 17 00:00:00 2001 From: Andy Lo Date: Thu, 21 Jul 2016 11:56:36 -0400 Subject: [PATCH] MN: Added 2017-2018 regular session pre-emptively. Cleaned up metadata formatting. --- openstates/mn/__init__.py | 126 ++++++++++++++++++++++---------------- 1 file changed, 74 insertions(+), 52 deletions(-) diff --git a/openstates/mn/__init__.py b/openstates/mn/__init__.py index 4d9d366cfd..a9b80f423e 100644 --- a/openstates/mn/__init__.py +++ b/openstates/mn/__init__.py @@ -15,19 +15,19 @@ There are not detailed vote data for Senate votes, simply yes and no counts. Bill pages have vote counts and links to House details, so it makes more sense to get vote data from the bill pages. - """ -metadata = dict( - name='Minnesota', - abbreviation='mn', - capitol_timezone='America/Chicago', - legislature_name='Minnesota State Legislature', - legislature_url='http://www.leg.state.mn.us/', - chambers = { + +metadata = { + 'name': 'Minnesota', + 'abbreviation': 'mn', + 'legislature_name': 'Minnesota State Legislature', + 'legislature_url': 'http://www.leg.state.mn.us/', + 'capitol_timezone': 'America/Chicago', + 'chambers': { 'upper': {'name': 'Senate', 'title': 'Senator'}, 'lower': {'name': 'House', 'title': 'Representative'}, }, - terms=[ + 'terms': [ { 'name': '2009-2010', 'sessions': ['2009-2010', '2010 1st Special Session', '2010 2nd Special Session'], @@ -56,93 +56,114 @@ 'end_year': 2016, 'biennium': 89, }, + { + 'name': '2017-2018', + 'sessions': ['2017-2018'], + 'start_year': 2017, + 'end_year': 2018, + 'biennium': 90, + }, ], - session_details={ + 'session_details': { '2009-2010': { - 'site_id': '0862009', 'type':'primary', - 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls86.asp', + 'type':'primary', 'display_name': '2009-2010 Regular Session', '_scraped_name': '86th Legislature, 2009-2010', + 'site_id': '0862009', + 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls86.asp', }, '2010 1st Special Session': { - 'site_id': '1862010', 'type':'special', - 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8620101.asp', + 'type': 'special', 'display_name': '2010, 1st Special Session', '_scraped_name': '86th Legislature, 2010 1st Special Session', + 'site_id': '1862010', + 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8620101.asp', }, '2010 2nd Special Session': { - 'site_id': '2862010', 'type':'special', + 'type':'special', 'display_name': '2010, 2nd Special Session', '_scraped_name': '86th Legislature, 2010 2nd Special Session', + 'site_id': '2862010', }, '2011-2012': { - 'site_id': '0872011', 'type':'primary', - 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls87.asp', + 'type':'primary', 'display_name': '2011-2012 Regular Session', '_scraped_name': '87th Legislature, 2011-2012', + 'site_id': '0872011', + 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls87.asp', }, '2011s1': { - 'site_id': '1872011', 'type': 'special', - 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8720111.asp', + 'type': 'special', 'display_name': '2011, 1st Special Session', '_scraped_name': '87th Legislature, 2011 1st Special Session', + 'site_id': '1872011', + 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8720111.asp', }, '2012s1': { - 'site_id': '1872012', 'type': 'special', - 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8720121.asp', + 'type': 'special', 'display_name': '2012, 1st Special Session', '_scraped_name': '87th Legislature, 2012 1st Special Session', + 'site_id': '1872012', 'type': 'special', + 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8720121.asp', }, '2013-2014': { - 'site_id': '0882013', - 'type': "primary", + 'type': 'primary', 'display_name': '2013-2014 Regular Session', '_scraped_name': '88th Legislature, 2013-2014', + 'site_id': '0882013', 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls88.asp', }, '2013s1': { - 'site_id': '1882013', 'type': 'special', - 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8820131.asp', + 'type': 'special', 'display_name': '2013, 1st Special Session', '_scraped_name': '88th Legislature, 2013 1st Special Session', + 'site_id': '1882013', + 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8820131.asp', }, '2015-2016': { - 'site_id': '0892015', - 'type': "primary", + 'type': 'primary', 'display_name': '2015-2016 Regular Session', '_scraped_name': '89th Legislature, 2015-2016', + 'site_id': '0892015', 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls89.asp', }, '2015s1': { - 'site_id': '1892015', 'type': 'special', - 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8920151.asp', + 'type': 'special', 'display_name': '2015, 1st Special Session', '_scraped_name': '89th Legislature, 2015 1st Special Session', + 'site_id': '1892015', + 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls8920151.asp', + }, + '2017-2018': { + 'type': 'primary', + 'display_name': '2017-2018 Regular Session', + '_scraped_name': '90th Legislature, 2017-2018', + 'site_id': '0902017', + 'votes_url': 'http://www.house.leg.state.mn.us/votes/getVotesls90.asp', }, - }, - feature_flags=['subjects', 'events', 'influenceexplorer'], - _ignored_scraped_sessions=['85th Legislature, 2007-2008', - '85th Legislature, 2007 1st Special Session', - '84th Legislature, 2005-2006', - '84th Legislature, 2005 1st Special Session', - '83rd Legislature, 2003-2004', - '83rd Legislature, 2003 1st Special Session', - '82nd Legislature, 2001-2002', - '82nd Legislature, 2002 1st Special Session', - '82nd Legislature, 2001 1st Special Session', - '81st Legislature, 1999-2000', - '80th Legislature, 1997-1998', - '80th Legislature, 1998 1st Special Session', - '80th Legislature, 1997 3rd Special Session', - '80th Legislature, 1997 2nd Special Session', - '80th Legislature, 1997 1st Special Session', - '79th Legislature, 1995-1996', - '79th Legislature, 1995 1st Special Session', - '89th Legislature, 2015-2016', - ] - -) + '_ignored_scraped_sessions': [ + '85th Legislature, 2007-2008', + '85th Legislature, 2007 1st Special Session', + '84th Legislature, 2005-2006', + '84th Legislature, 2005 1st Special Session', + '83rd Legislature, 2003-2004', + '83rd Legislature, 2003 1st Special Session', + '82nd Legislature, 2001-2002', + '82nd Legislature, 2002 1st Special Session', + '82nd Legislature, 2001 1st Special Session', + '81st Legislature, 1999-2000', + '80th Legislature, 1997-1998', + '80th Legislature, 1998 1st Special Session', + '80th Legislature, 1997 3rd Special Session', + '80th Legislature, 1997 2nd Special Session', + '80th Legislature, 1997 1st Special Session', + '79th Legislature, 1995-1996', + '79th Legislature, 1995 1st Special Session', + '89th Legislature, 2015-2016', + ], + 'feature_flags': ['subjects', 'events', 'influenceexplorer'], +} def session_list(): @@ -151,6 +172,7 @@ def session_list(): 'status_search.php?body=House', '//select[@name="session"]/option/text()') + def extract_text(doc, data): doc = lxml.html.fromstring(data) xtend = doc.xpath('//div[@class="xtend"]')[0].text_content()