Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: scytl connector #737

Merged
merged 17 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/scytl.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Scytl
=========

********
Overview
********

Scytl, or Clarity Elections, is a company that creates a tool for publishing election results in real-time. It's used in the U.S. by several states and over 800 counties, including Georgia, Colorado, Arkansas, and Dallas County, Texas.

For each participating election administrator, they publish a site with results that can be published on election night. Unfortunately, while that site contains downloadable data, that data is formatted in a complex way, making it difficult for developers to fetch election results. In general, their results either come zipped in either an unformatted text file or a complex XML document. Summary results come as a zipped CSV, but just contain top-line results. The JSON that powers the site results is even more complicated.

This connector provides methods to download the latest election results from their site and formats them into readable lists of dictionaries, which can easily be converted into a Parsons Table or Pandas dataframe.

Because this connector is can be useful for live reporting, it also contains a polling feature. As long as the class is instantiated, it will only fetch results that are new since the previous fetch of that method. To skip this feature, set force_update to true on any of the fetch methods.

agreenspan24 marked this conversation as resolved.
Show resolved Hide resolved
**********
Quickstart
**********

To get started, initialize a Scytl class with the two-letter state code, the election id, and the county name (optional).

To get these details, go to the website for the given election, and look in the url. For example, if the url is "https://results.enr.clarityelections.com/TX/Dallas/114890/web.285569/", then the state is "TX", the county is "Dallas", and the election ID is "114890". If the url is "https://results.enr.clarityelections.com/GA/114729/web.285569/", the state is "GA" and the election ID is "114729".


.. code-block:: python

from parsons import Scytl

scy = Scytl(state = 'GA', election_id = '114729')

# Get detailed results by geography
scy.get_detailed_results()


**************
Scytl Class
**************

.. autoclass :: parsons.Scytl
:inherited-members:
1 change: 1 addition & 0 deletions parsons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
("parsons.redash.redash", "Redash"),
("parsons.rockthevote.rtv", "RockTheVote"),
("parsons.salesforce.salesforce", "Salesforce"),
("parsons.scytl.scytl", "Scytl"),
("parsons.sftp.sftp", "SFTP"),
("parsons.shopify.shopify", "Shopify"),
("parsons.sisense.sisense", "Sisense"),
Expand Down
5 changes: 5 additions & 0 deletions parsons/scytl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from parsons.scytl.scytl import Scytl

__all__ = [
'Scytl'
]
Loading