项目作者: datadesk

项目描述 :
Parses election results data published online by the Los Angeles County Registrar-Recorder/County Clerk
高级语言: Python
项目地址: git://github.com/datadesk/la-election-night.git
创建时间: 2018-10-22T20:12:38Z
项目社区:https://github.com/datadesk/la-election-night

开源协议:MIT License

下载


la-election-night

Parse historical and election night result files published by the Los Angeles County Registrar-Recorder/County Clerk.

Get started

Install the library from PyPI

  1. $ pipenv install la-election-night

Import the library. Get the latest data from the URL you provide. That’s it.

  1. >>> import la_election_night
  2. >>> la_election_night.get('http://rrcc.co.la.ca.us/results/0018nov18.ets')
  3. [
  4. {
  5. "record_number": "001",
  6. "record_type": "measure",
  7. "title": "LA CO FLOOD CONTROL DIST MEASURE W",
  8. "precincts_total": 4551,
  9. "precincts_reporting": 4551,
  10. "precincts_reporting_pct": 1.0,
  11. "results": [
  12. {
  13. "name": "YES",
  14. "votes": 134294,
  15. "vote_pct": 0.6668999999999999,
  16. "party": ""
  17. },
  18. {
  19. "name": "NO",
  20. "votes": 67064,
  21. "vote_pct": 0.3331,
  22. "party": ""
  23. }
  24. ]
  25. },
  26. ...

You can example of how the data is parsed out can be seen here.

License

MIT