Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Add league rounds diagram #197

Open
frantzheld opened this issue Aug 1, 2022 · 2 comments
Open

Add league rounds diagram #197

frantzheld opened this issue Aug 1, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@frantzheld
Copy link

Describe the Feature
Add a diagram to show the developing of league ranking. See example below.

Screenshots
image

Python code

import requests
import pandas as pd

season = 2022
df = pd.DataFrame()

for i in range(14):
    url = 'https://api.weglide.org/v1/league/total/' + str(i) + '?name=DN&season=' + str(season)
    league = requests.get(url).json()
    
    club_names = [club['club']['name'] for club in league]
    points = [club['league_points'] for club in league]

    df2 = pd.DataFrame([points],columns=club_names)
    df = pd.concat([df,df2], ignore_index=True)
    
    
#%% Plot data
df.columns.name = 'Verein'
df.index.name = 'Runde'
clubs=['Hannoverscher Aero-Club','FSV Celle','LSV Stade','HVL Boberg','AC Hodenhagen','VfL Südheide']
df[clubs].plot(figsize=(12,8),markersize=10,grid=True,marker='.',title='Verlauf Regionalliga Nord')
@frantzheld frantzheld added the enhancement New feature or request label Aug 1, 2022
@moldhouse
Copy link

I think we could build a custom endpoint for that. @samuel-git we don't use diagrams anywhere in the frontend, so this is probably part of a bigger update?

@samuel-git
Copy link
Contributor

Yes, this involves some more work. I would like to get a feel how many people this would use first.
Maybe we can provide it as a separate service/repo ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants