Skip to content
Snippets Groups Projects
Commit 07d62802 authored by Enrique Garcia's avatar Enrique Garcia
Browse files

Merge branch 'ossr_stats' into 'master'

adding notebook with OSSR global stats

See merge request !63
parents 5451fc58 11387703
No related branches found
No related tags found
1 merge request!63adding notebook with OSSR global stats
Pipeline #139592 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.
Please register or to comment