yig/cceexplorer/analyser.py

30 lines
949 B
Python
Raw Normal View History

2024-05-19 17:56:26 -05:00
from leglib.billdb import BillDB, BillQuery, QueryField, QueryAll
from leglib.parsers import HSYIGPdfParser
2024-05-03 05:58:33 -05:00
2024-05-19 17:56:26 -05:00
parser = HSYIGPdfParser.from_filename(
filename="YIGVolunteerBook2024.pdf",
2024-05-19 17:51:51 -05:00
confname="HSVolunteer"
)
parser.parse()
2024-05-19 17:51:51 -05:00
print(len(parser.bills))
2024-05-19 17:56:26 -05:00
db = BillDB()
2024-05-19 17:51:51 -05:00
db.add_conference(parser=parser)
2024-05-19 17:56:26 -05:00
allbills = len(db.search(query=QueryAll))
2024-05-19 17:51:51 -05:00
2024-05-19 17:56:26 -05:00
bluelen = len(db.search(query=BillQuery(color=QueryField.Colors.Blue)))
whitelen = len(db.search(query=BillQuery(color=QueryField.Colors.White)))
redlen = len(db.search(query=BillQuery(color=QueryField.Colors.Red)))
2024-05-19 17:51:51 -05:00
2024-05-19 17:56:26 -05:00
senatelen = len(db.search(query=BillQuery(assembly=QueryField.Assemblies.Senate)))
houselen = len(db.search(query=BillQuery(assembly=QueryField.Assemblies.House)))
2024-05-19 17:51:51 -05:00
2024-05-19 17:56:26 -05:00
franklincount = len(db.search(query=BillQuery(school="Franklin")))
2024-05-19 17:51:51 -05:00
print(allbills)
print(redlen, whitelen, bluelen, redlen + whitelen + bluelen)
print(senatelen, houselen, senatelen + houselen)
print(franklincount)