opencivicdata / pupa

framework for scraping legislative/government data
BSD 3-Clause "New" or "Revised" License
85 stars 42 forks source link

Apply order to VoteEvents. #323

Closed estaub closed 4 years ago

estaub commented 4 years ago

OpenStates VoteEvents are often impossible to order within a given day, because chambers often provide the date of a vote without a time of day, and because the OCD VoteEvent definition does not provide an order field similar to BillAction.

This PR provides a scraper-based stopgap means of ordering votes, by adding an order value in seconds to start_date and end_date, when they have no time-of-day component. A scraper creates a single instance of OrderVoteEvent (herein) and then passing each VoteEvent through it before emitting.

When and if an "order" value is added to VoteEvent, it could be filled by this as well. I'll start on that shortly and see how it goes.

This has been tested in situ with only a single state, New Hampshire, but I hope and believe the usage pattern is applicable to all scraper designs.