Skip to content

Commit a2442c4

Browse files
authored
Merge pull request #74 from z3c0/test (v0.9.33)
v0.9.33
2 parents ef1b2b0 + fb63c6a commit a2442c4

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

.github/workflows/perform-integration-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
uses: actions/setup-python@v1
1818
with:
1919
python-version: 3.8
20+
- name: Wait 15 minutes for new version to become available
21+
run: |
22+
sleep 15m
2023
- name: Install test dependencies
2124
run: |
2225
python -m pip install --upgrade pip

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,7 @@ if __name__ == '__main__':
484484

485485
### Why was Vistos created?
486486

487-
Due to the competitive nature of the American economy, media outlets have been forced to set themselves apart from each other by marketing themselves to certain sets of ideologies. When occurring en masse, this can cause a single issue to be fractured into wildly-divergent perspectives. In moderation, this is a good thing, as reporting on the multiple perspectives around a single issue is integral to a functional democratic society. However, the rift between these perspectives has become so great that the average person can have a very difficult time getting a handle on the facts of a common political topic. To counter the confusion created by the media, citizens will need easier access to a more objective record of happenings within the political world. Fortunately, the publishing of such information is an existing function of the U. S. legislative branch, via the [Government Publishing Office](https://www.gpo.gov/). For more than a century, this has been the primary source for data pertaining to all three branches of the U. S. Government. While both media and GPO data are available on the internet, the succint delivery of a news article is much more alluring to the average citizen than the wordiness of a [congressional bill](https://www.congress.gov/bill/116th-congress/house-bill/748). If the average citizen is going to become less reliant on modern media for poltical information, work will need to be done to bridge this gap. The goal of Vistos is not necessarily to be the bridge over said gap, but to be the foundation on which to build the bridge.
488-
489-
**Plainly stated, the function of Vistos is to enable people to more easily gather and present poltical information.** This idea is meant to be the guiding thought for defining the scope of Vistos - that is to say that any data that enables U. S. citizens to be more politically informed can be considered an option for Vistos. This is, without a doubt, a very broad scope. If left uncheck, this approach could turn Vistos into a tool that does a lot of things very poorly, with no clear direction. To guide new additions to the project and prevent the project from falling into a state of over-ambitious aimlessness, all new work will be weighed against how easy it is to implement against what exists already.
487+
Plainly stated, the function of Vistos is to enable people to more easily gather and present poltical information. This idea is meant to be the guiding thought for defining the scope of Vistos - that is to say that any data that enables U. S. citizens to be more politically informed can be considered an option for Vistos. To guide new additions to the project and prevent the project from falling into a state of over-ambitious aimlessness, all new work will be weighted by how easy it is to implement against what exists already.
490488

491489
### So why Python?
492490

vistos/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.31
1+
0.9.33

vistos/src/gpo/bioguideretro.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,22 @@ def party(self) -> str:
146146
return self[fields.Term.PARTY]
147147

148148

149+
class BioguideTermList(list):
150+
"""A list-based class for handling multiple BioguideTermRecords"""
151+
152+
def __init__(self, term_list: List[BioguideTermRecord]):
153+
super().__init__()
154+
for term in term_list:
155+
self.append(term)
156+
157+
def __str__(self):
158+
return self.to_json()
159+
160+
def to_json(self) -> str:
161+
"""Returns the current member list as a JSON string"""
162+
return json.dumps(self)
163+
164+
149165
class BioguideMemberRecord(dict):
150166
"""A class for handing bioguide member data"""
151167

@@ -261,7 +277,7 @@ def biography(self) -> str:
261277
return self[fields.Member.BIOGRAPHY]
262278

263279
@property
264-
def terms(self) -> List[BioguideTermRecord]:
280+
def terms(self) -> BioguideTermList:
265281
"""a US Congress member's terms"""
266282
return self[fields.Member.TERMS]
267283

@@ -368,7 +384,6 @@ def members(self) -> BioguideMemberList:
368384
BioguideMembersFunc = Callable[[], BioguideMemberList]
369385
BioguideMemberFunc = Callable[[], BioguideMemberRecord]
370386
BioguideCongressFunc = Callable[[], BioguideCongressRecord]
371-
BioguideTermList = List[BioguideTermRecord]
372387

373388

374389
# Bioguide Functions
@@ -471,7 +486,7 @@ def _merge_terms(term_records: BioguideTermList) -> BioguideTermList:
471486
except KeyError:
472487
merged_terms[term.congress_number] = term
473488

474-
return list(merged_terms.values())
489+
return BioguideTermList(merged_terms.values())
475490

476491

477492
def _query_member_by_id(bioguide_id: str) -> BioguideMemberRecord:

0 commit comments

Comments
 (0)