Skip to content
Snippets Groups Projects
Commit 11387703 authored by vuillaut's avatar vuillaut
Browse files

adding notebook with OSSR global stats

parent 242a8638
No related branches found
No related tags found
1 merge request!63adding notebook with OSSR global stats
Pipeline #139518 passed
%% Cell type:code id:457f7641 tags:
``` python
from eossr.api import get_ossr_records
from IPython.display import Markdown as md
from datetime import date
```
%% Cell type:code id:b9668e64 tags:
``` python
title = f"# OSSR statistics on the {date.today()}"
ossr_records = get_ossr_records()
stats_names = ['downloads', 'unique_downloads', 'views', 'unique_views', ]
sum_stats = {key: sum([int(rec.data['stats'][key]) for rec in ossr_records]) for key in stats_names}
text = f"## There are {len(ossr_records)} records in the OSSR.\n"
for key, value in sum_stats.items():
text+=f"{key.replace('_', ' ')}: {value}\n\n"
```
%% Cell type:code id:2f5effcb tags:
``` python
```
%% Cell type:code id:fe656e0b tags:
``` python
md(title)
```
%% Cell type:code id:df351e32 tags:
``` python
md(text)
```
%% Cell type:code id:d0e84058 tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment