{"id":20634426,"url":"https://github.com/bcongdon/pyvethirtyeight","last_synced_at":"2025-10-14T04:50:34.339Z","repository":{"id":80472031,"uuid":"70426505","full_name":"bcongdon/pyvethirtyeight","owner":"bcongdon","description":":us: Python wrapper for Fivethirtyeight's Election Forecasts","archived":false,"fork":false,"pushed_at":"2016-10-22T23:23:32.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T03:37:24.072Z","etag":null,"topics":["fivethirtyeight","forecast","python-wrapper"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcongdon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-09T19:47:51.000Z","updated_at":"2016-10-22T23:51:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"14461e41-8a28-470d-919b-079ce1e265d7","html_url":"https://github.com/bcongdon/pyvethirtyeight","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bcongdon/pyvethirtyeight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcongdon%2Fpyvethirtyeight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcongdon%2Fpyvethirtyeight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcongdon%2Fpyvethirtyeight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcongdon%2Fpyvethirtyeight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcongdon","download_url":"https://codeload.github.com/bcongdon/pyvethirtyeight/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcongdon%2Fpyvethirtyeight/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263061404,"owners_count":23407606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fivethirtyeight","forecast","python-wrapper"],"created_at":"2024-11-16T14:25:20.459Z","updated_at":"2025-10-14T04:50:29.302Z","avatar_url":"https://github.com/bcongdon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyveThirtyEight\n\u003e A Python wrapper for the 2016 [FiveThirtyEight](projects.fivethirtyeight.com/2016-election-forecast/) Presidential Election Forecast \n\n[![PyPI version](https://badge.fury.io/py/pyvethirtyeight.svg)](https://badge.fury.io/py/pyvethirtyeight)\n[![Build Status](https://travis-ci.org/bcongdon/pyvethirtyeight.svg?branch=master)](https://travis-ci.org/bcongdon/pyvethirtyeight)\n\n## Installation\n```\npip install pyvethirtyeight\n```\n\n## Usage\n```python\nfrom pyvethirtyeight import President, Senate\n\n# Presidential Election Forecasts\nf = President()\n\n# Latest Forecasts (Unordered)\nlatest = f.latest_forecasts()\nlatest[0].party # 'D'\n\n# Current Leader (returns Forecast of latest leader)\nleader = f.current_leader()\nprint(leader.models['plus']['winprob']) # 83.99\n\n# Current Leader by Model\nleader = f.current_leader(model='now')\nprint(leader.models['now']['winprob']) # 90.4\n\n# All Forecasts\nall_forecasts = f.all_forecasts()\n\n# Same methods also work with Senate predictions\ns = Senate()\nprint(s.latest_forecasts()[0].models['polls']['winprob']) # 67.33596\n```\n\n#### The Forecast Object\nA `Forecast` is the prediction of the FiveThirtyEight model for a particular candidate at a particular moment in time\n\nA `Forecast` has keys:\n\n\t- date (datetime) -\u003e Forecast date\n\t- party (str) -\u003e Candidate's party initial\n\t- candidate (str) -\u003e Candidate's name\n\t- models (Dict) -\u003e Dict of model predictions associated with candidate","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcongdon%2Fpyvethirtyeight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcongdon%2Fpyvethirtyeight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcongdon%2Fpyvethirtyeight/lists"}