The current situation has been managed manually; as scrapers break due to the session list having new entries, we add new sessions. We try to research the correct dates, but they’re often an estimate since many states end up extending their sessions or not publishing a formal end date. If a session has multiple periods, (ie jan 1- mar 1 2017, jan 1 - mar 1 2018), we just overwrite the old ones.
Even states with statutory end dates can be fluid or complicated to compute (eg “The fourth fifth legislative day excluding holidays and early adjournments” and then they decide halfway through to start taking fridays off and just run a few weeks later). Many commercial sources publish calendars at the start of the new year, which is helpful, although they all differ a little.
They’re “sorted” in the sense that we want to keep the most recent “live” one the default so that we can just run “pupa update ABBR” and have it work, and we tend to just add new entries onto the end of the list. This has created a “mostly correctly sorted” historical list, but isn’t always accurate right now.
Some states run multiple sessions and/or specials simultaneously (LA and UT off the top of my head), or stop and start, interspersed with specials, which breaks this a bit. Term was nice for keeping track of this, but didn’t actually tell you what sessions were “live” at any given time, in the sense that changes could (or could no longer) happen.
Just FYI I’d strongly recommend you work off some kind of manually managed “current sessions in each state” file, as trying to map calendar dates to ‘active’ sessions is a fraught approach for a couple of reasons:
- Many states don’t give reliable dates for session end, or they pop in and out, or they add ‘special’ session info to the regular session’s website data.
- Actions can still happen in some states after the legislature is out. Primarily executive actions. but in a few states hearings happen or supplementary docs and sponsorships can change all year, even if the legislature is out of session.
- Prefiling, which we usually have covered because we switch the default session even before it starts, but some states also allow prefiling for the next session before the current one ends (IL, NY i believe).
I’d be open the idea of adding some kind of file/API for this to Openstates, but a I’m concerned about having one more thing to keep it up to date. @james is there any way to link up the scripts that actually run the scrapes at night to the API, so it would be clear what data OS is currently grabbing at least?