From f7f953efdde76c83aeaa683eddd59841a800aa04 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sun, 31 Aug 2025 12:27:38 +0200 Subject: [PATCH] ajout info historique propositions --- wiki_compare/archived_proposals.json | 520 +---------------------- wiki_compare/fetch_archived_proposals.py | 22 +- 2 files changed, 33 insertions(+), 509 deletions(-) diff --git a/wiki_compare/archived_proposals.json b/wiki_compare/archived_proposals.json index 52624dea..d17d6aee 100644 --- a/wiki_compare/archived_proposals.json +++ b/wiki_compare/archived_proposals.json @@ -1,11 +1,12 @@ { - "last_updated": "2025-08-31T12:12:58.757275", + "last_updated": "2025-08-31T12:25:59.979891", "proposals": [ { "title": "Proposal:4WD Only", "url": "https://wiki.openstreetmap.org/wiki/Proposal:4WD_Only", "last_modified": "30 April 2023", "proposer": "Gaffa", + "status": "Approved", "section_count": 0, "link_count": 16, "word_count": 152, @@ -33,6 +34,7 @@ "url": "https://wiki.openstreetmap.org/wiki/Proposal:Access:_name_space", "last_modified": "30 April 2023", "proposer": "Hawke", + "status": "Canceled", "section_count": 0, "link_count": 11, "word_count": 109, @@ -54,514 +56,18 @@ "approve_percentage": 0, "oppose_percentage": 0, "abstain_percentage": 0 - }, - { - "title": "Proposal:Add ability to specify ordering-only phone number, sms-only phone numbers and related tags", - "url": "https://wiki.openstreetmap.org/wiki/Proposal:Add_ability_to_specify_ordering-only_phone_number,_sms-only_phone_numbers_and_related_tags", - "last_modified": "8 June 2025", - "proposer": "JOlshefsky", - "section_count": 10, - "link_count": 104, - "word_count": 808, - "votes": { - "approve": { - "count": 11, - "users": [ - { - "username": "JOlshefsky", - "date": "10:52, 16 July 2024" - }, - { - "username": "Mueschel", - "date": "09:40, 18 July 2024" - }, - { - "username": "Chris2map", - "date": "17:11, 18 July 2024" - }, - { - "username": "Broiledpeas", - "date": "22:20, 18 July 2024" - }, - { - "username": "Nospam2005", - "date": "19:59, 21 July 2024" - }, - { - "username": "GanderPL", - "date": "08:50, 22 July 2024" - }, - { - "username": "EneaSuper", - "date": "14:04, 22 July 2024" - }, - { - "username": "Uboot", - "date": "07:20, 25 July 2024" - }, - { - "username": "Jean-Baptiste", - "date": "12:40, 28 July 2024" - }, - { - "username": "Emmanuel", - "date": "18:14, 28 July 2024" - }, - { - "username": "Hocu", - "date": "06:06, 31 July 2024" - } - ] - }, - "oppose": { - "count": 0, - "users": [] - }, - "abstain": { - "count": 4, - "users": [ - { - "username": "Woodpeck", - "date": "21:15, 19 July 2024" - }, - { - "username": "Hedaja", - "date": "15:41, 21 July 2024" - }, - { - "username": "501ghost", - "date": "06:36, 24 July 2024" - }, - { - "username": "Nadjita", - "date": "08:33, 26 July 2024" - } - ] - } - }, - "total_votes": 15, - "approve_percentage": 73.3, - "oppose_percentage": 0.0, - "abstain_percentage": 26.7 - }, - { - "title": "Proposal:Add strolling to sac scale and some further refinements", - "url": "https://wiki.openstreetmap.org/wiki/Proposal:Add_strolling_to_sac_scale_and_some_further_refinements", - "last_modified": "5 November 2024", - "proposer": null, - "section_count": 20, - "link_count": 268, - "word_count": 2329, - "votes": { - "approve": { - "count": 21, - "users": [ - { - "username": "Supsup", - "date": "18:21, 15 October 2024" - }, - { - "username": "Cick0", - "date": "21:43, 15 October 2024" - }, - { - "username": "Fizzie41", - "date": "21:47, 15 October 2024" - }, - { - "username": "Segubi", - "date": null - }, - { - "username": "rhhs", - "date": "06:43, 16 October 2024" - }, - { - "username": "Alan", - "date": "07:39, 16 October 2024" - }, - { - "username": "VojtaFilip", - "date": "08:00, 16 October 2024" - }, - { - "username": "Adamfranco", - "date": "13:21, 16 October 2024" - }, - { - "username": "Yvecai", - "date": "05:07, 18 October 2024" - }, - { - "username": "Woazboat", - "date": "12:15, 18 October 2024" - }, - { - "username": "julcnx", - "date": "15:16, 20 October 2024" - }, - { - "username": "JIDB", - "date": "17:17, 20 October 2024" - }, - { - "username": "Pb07", - "date": "18:04, 20 October 2024" - }, - { - "username": "Lumikeiju", - "date": "18:46, 20 October 2024" - }, - { - "username": "Heilbron", - "date": "20:43, 20 October 2024" - }, - { - "username": "Aighes", - "date": "21:30, 20 October 2024" - }, - { - "username": "Crodthauser", - "date": "21:55, 20 October 2024" - }, - { - "username": "Adiatmad", - "date": "02:26, 21 October 2024" - }, - { - "username": "Jonathan", - "date": "10:46, 21 October 2024" - }, - { - "username": "mahau", - "date": "17:34, 21 October 2024" - }, - { - "username": "EneaSuper", - "date": "13:43, 27 October 2024" - } - ] - }, - "oppose": { - "count": 4, - "users": [ - { - "username": "chris66", - "date": "06:22, 16 October 2024" - }, - { - "username": "Skyper", - "date": "11:55, 16 October 2024" - }, - { - "username": "Nop", - "date": "06:41, 17 October 2024" - }, - { - "username": "Fabi2", - "date": "19:27, 20 October 2024" - } - ] - }, - "abstain": { - "count": 2, - "users": [ - { - "username": "Chris2map", - "date": "17:39, 17 October 2024" - }, - { - "username": "Nospam2005", - "date": "13:40, 20 October 2024" - } - ] - } - }, - "total_votes": 27, - "approve_percentage": 77.8, - "oppose_percentage": 14.8, - "abstain_percentage": 7.4 } ], "statistics": { - "total_proposals": 4, - "total_votes": 42, - "avg_votes_per_proposal": 10.5, - "unique_voters": 39, - "top_voters": [ - { - "username": "Chris2map", - "total": 2, - "approve": 1, - "oppose": 0, - "abstain": 1 - }, - { - "username": "Nospam2005", - "total": 2, - "approve": 1, - "oppose": 0, - "abstain": 1 - }, - { - "username": "EneaSuper", - "total": 2, - "approve": 2, - "oppose": 0, - "abstain": 0 - }, - { - "username": "JOlshefsky", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Mueschel", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Broiledpeas", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "GanderPL", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Uboot", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Jean-Baptiste", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Emmanuel", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Hocu", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Woodpeck", - "total": 1, - "approve": 0, - "oppose": 0, - "abstain": 1 - }, - { - "username": "Hedaja", - "total": 1, - "approve": 0, - "oppose": 0, - "abstain": 1 - }, - { - "username": "501ghost", - "total": 1, - "approve": 0, - "oppose": 0, - "abstain": 1 - }, - { - "username": "Nadjita", - "total": 1, - "approve": 0, - "oppose": 0, - "abstain": 1 - }, - { - "username": "Supsup", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Cick0", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Fizzie41", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Segubi", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "rhhs", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Alan", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "VojtaFilip", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Adamfranco", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Yvecai", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Woazboat", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "julcnx", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "JIDB", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Pb07", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Lumikeiju", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Heilbron", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Aighes", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Crodthauser", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Adiatmad", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "Jonathan", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "mahau", - "total": 1, - "approve": 1, - "oppose": 0, - "abstain": 0 - }, - { - "username": "chris66", - "total": 1, - "approve": 0, - "oppose": 1, - "abstain": 0 - }, - { - "username": "Skyper", - "total": 1, - "approve": 0, - "oppose": 1, - "abstain": 0 - }, - { - "username": "Nop", - "total": 1, - "approve": 0, - "oppose": 1, - "abstain": 0 - }, - { - "username": "Fabi2", - "total": 1, - "approve": 0, - "oppose": 1, - "abstain": 0 - } - ] + "total_proposals": 2, + "total_votes": 0, + "avg_votes_per_proposal": 0.0, + "avg_vote_duration_days": 0, + "unique_voters": 0, + "top_voters": [], + "status_distribution": { + "Approved": 1, + "Canceled": 1 + } } } \ No newline at end of file diff --git a/wiki_compare/fetch_archived_proposals.py b/wiki_compare/fetch_archived_proposals.py index 1af23810..c9ea1ba3 100644 --- a/wiki_compare/fetch_archived_proposals.py +++ b/wiki_compare/fetch_archived_proposals.py @@ -605,15 +605,33 @@ def main(): [{'username': k, **v} for k, v in voter_counts.items()], key=lambda x: x['total'], reverse=True - )[:100] # Top 20 voters + )[:100] # Top 100 voters + + # Count proposals by status + status_counts = {} + for p in new_proposals: + status = p.get('status') + if status: + status_counts[status] = status_counts.get(status, 0) + 1 + else: + status_counts['Unknown'] = status_counts.get('Unknown', 0) + 1 + + # Calculate average vote duration + proposals_with_duration = [p for p in new_proposals if 'votes' in p and 'duration_days' in p['votes']] + avg_vote_duration = 0 + if proposals_with_duration: + total_duration = sum(p['votes']['duration_days'] for p in proposals_with_duration) + avg_vote_duration = round(total_duration / len(proposals_with_duration), 1) # Add statistics to the data data['statistics'] = { 'total_proposals': total_proposals, 'total_votes': total_votes, 'avg_votes_per_proposal': avg_votes_per_proposal, + 'avg_vote_duration_days': avg_vote_duration, 'unique_voters': len(all_voters), - 'top_voters': top_voters + 'top_voters': top_voters, + 'status_distribution': status_counts } # Save the data