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

Parse & include votes data #17

Closed
15 of 35 tasks
RouxRC opened this issue May 29, 2017 · 3 comments
Closed
15 of 35 tasks

Parse & include votes data #17

RouxRC opened this issue May 29, 2017 · 3 comments

Comments

@RouxRC
Copy link
Member

RouxRC commented May 29, 2017

  • parse to return MP's and groups details
  • Parse/clean demandeurs + extract group WARNING can be multiple -> schema change?
  • fix groupes acronymes to match ND's (LAREM −> LREM)
  • Fix votes mis au point missing groupe fields
  • Handle cases of intervention not found https://pad.regardscitoyens.org/p/nosdeputes-scrutins
  • attach vote to specific debate
  • add presences to MPs voting without delegation
  • check presences added limited to actual votes and not rectif without previous position
  • check presences added limited to date of first published delegations
    • validate date begin presences 5a48a93
  • check delegations on scrutins non solennels
  • check missing scrutins (1106 sur 1118, motions notamment mais pas que)
  • check if non votant should be considered as presence or not (some cases just president, sometimes both presidents) if only president, no need as they always talk anyways
  • check stats on mise au points, nonvotants, seance null, demandeur null, ...
  • check data properly updated on load when scrutin modified
  • adjust logs for crons
  • add more doc/faq on votes (+ link in api to faq)
  • display scrutins in seances

Extras:

@Massiliane
Copy link

Le scrutin public du 22/04/2018 de l'AN affiche les délégations de votes : http://www2.assemblee-nationale.fr/scrutins/detail/(legislature)/15/(num)/578#G0

@RouxRC RouxRC mentioned this issue Aug 16, 2018
60 tasks
@RouxRC
Copy link
Member Author

RouxRC commented Aug 16, 2018

Quelques stats sur les données parsées :

  • Résultats des scrutins :
ls scrutins/*.json | while read f; do json $f | grep '"sort"'; done  | sort | uniq -c | sort -gr
    848     "sort": "rejet\u00e9",
    258     "sort": "adopt\u00e9",
  • Types de scrutins :
ls scrutins/*.json | while read f; do json $f | grep '"type"'; done  | sort | uniq -c | sort -gr
   1073     "type": "ordinaire"
     33     "type": "solennel"
  • Parts de scrutins avec délégation :
ls scrutins/*.json | while read f; do json $f | grep "par_delegation"; done  | sort | uniq -c | sort -gr
 120179             "par_delegation": false,
   2560             "par_delegation": null,
   1760             "par_delegation": true,
  • Premiers scrutins avec délégation :
solennel : 2017-10-24 http://www2.assemblee-nationale.fr/scrutins/detail/(legislature)/15/(num)/183
ordinaire : 2018-03-21 http://www2.assemblee-nationale.fr/scrutins/detail/(legislature)/15/(num)/424
  • Types de scrutins avec délégation :
grep -c 'par_delegation": true' scrutins/*.json | grep -v ":0" | sed 's/:1//' | while read f; do json $f | grep '"type"'; done | sort | uniq -c | sort -gr
     22     "type": "ordinaire"
     14     "type": "solennel"
  • Usage des délégations par groupe :
ls scrutins/*.json | while read f; do json $f | grep -B 3 'delegation": true' | grep groupe; done | sort | uniq -c | sort -gr
    943             "groupe": "LREM",
    334             "groupe": "LR",
    125             "groupe": "MODEM",
    102             "groupe": "NG",
    102             "groupe": "UAI",
     59             "groupe": "GDR",
     46             "groupe": "LFI",
     33             "groupe": "NI",
     16             "groupe": "LC",
  • Positions :
ls scrutins/*.json | while read f; do json $f | grep '"position"'; done  | sort | uniq -c | sort -gr
  69728             "position": "contre",
  46954             "position": "pour",
   5581             "position": "abstention",
   1989             "position": "nonVotant",
    247             "position": null,
  • Mises au point :
ls scrutins/*.json | while read f; do json $f | grep 'point_position'; done  | sort | uniq -c | sort -gr
 124027             "mise_au_point_position": null,
    257             "mise_au_point_position": "pour",
    167             "mise_au_point_position": "contre",
     31             "mise_au_point_position": "nonVotantVolontaire",
     13             "mise_au_point_position": "abstention",
      4             "mise_au_point_position": "nonVotant",
  • Positions avant mise au point :
ls scrutins/*.json | while read f; do json $f | grep -A 4 'mise_au_point_position": "' | grep '"position"'; done | sort | uniq -c | sort -gr
    247             "position": null,
    117             "position": "contre",
     96             "position": "pour",
     10             "position": "abstention",
      2             "position": "nonVotant",
  • Usage des mises au point par groupe :
ls scrutins/*.json | while read f; do json $f | grep -B 1 'mise_au_point_position": "' | grep groupe; done | sort | uniq -c | sort -gr
    334             "groupe": "LREM",
     39             "groupe": "LR",
     33             "groupe": "MODEM",
     21             "groupe": "LFI",
     19             "groupe": "NG",
     10             "groupe": "GDR",
     10             "groupe": "LC",
      4             "groupe": "NI",
      2             "groupe": "UAI",
  • Demandeurs :
ls scrutins/*.json | while read f; do python -m json.tool $f | grep '^        "' | grep -v ' "PA' | sed 's/\\u00e9/e/g' | sed 's/President[^\s]* du groupe [^A-Z]*\(.*\)/\L\1/' | sed 's/,$//'; done  | sort | uniq -c | sort -gr
    267         "les republicains"
    245         "la france insoumise"
    237         "gauche democrate et republicaine"
    237         "nouvelle gauche"
     69         "la republique en marche"
     57         "udi, agir et independants"
     29         "Conference des Presidents"
     19         "mouvement democrate et apparentes"
     18         "les constructifs : republicains, udi, independants"
      1         "Gouvernement"
  • Groupes codemandeurs :
SELECT count(id) as n, demandeurs_groupes_acronymes FROM scrutin WHERE  demandeurs_groupes_acronymes LIKE  '%|%' GROUP BY demandeurs_groupes_acronymes
n	demandeurs_groupes_acronymes
8	NG|GDR
6	LFI|GDR
4	NG|LFI
4	LR|GDR
4	GDR|LFI
3	NG|LR
3	LR|UAI
3	GDR|NG
2	LREM|LR
2	LREM|GDR
2	GDR|LR
1	UAI|LR
1	UAI|LFI
1	UAI|GDR
1	NG|LR|LREM|GDR
1	NG|LREM|GDR
1	NG|LFI|GDR
1	NG|LC
1	NG|GDR|LFI
1	LR|LREM
1	LR|LC|LREM
1	LREM|NG
1	LREM|MODEM
1	LREM|GDR|NG
1	LFI|NG|UAI
1	LFI|LR|NG
1	LFI|LR|GDR|NG
1	LFI|LREM
1	LFI|LC
1	LC|NG
1	LC|LFI
1	GDR|UAI

  • Répartition des groupes des votants :
ls scrutins/*.json | while read f; do json $f | grep '"groupe"'; done  | sort | uniq -c | sort -gr
  76684             "groupe": "LREM",
  16440             "groupe": "LR",
   9571             "groupe": "MODEM",
   5377             "groupe": "NG",
   5117             "groupe": "LFI",
   3394             "groupe": "GDR",
   3341             "groupe": "NI",
   2862             "groupe": "UAI",
   1713             "groupe": "LC",
  • Séances avec le plus de scrutins :
ls scrutins/*.json | while read f; do json $f | grep '"seance"'; done  | sort | uniq -c | sort -gr | head -n 10
     72     "seance": "20180263",
     27     "seance": "20180206",
     18     "seance": "20180249",
     17     "seance": "20180248",
     15     "seance": "20171012",
     13     "seance": "20180256",
     13     "seance": "20180212",
     13     "seance": "20180203",
     12     "seance": "20180213",
     12     "seance": "20180128",

@RouxRC
Copy link
Member Author

RouxRC commented Aug 17, 2018

migrating all of this into PR #115

@RouxRC RouxRC closed this as completed Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants