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

move ossr stats in docs only and hide cellss

parent a8401d07
No related branches found
No related tags found
1 merge request!65move ossr stats in docs only and hide cellss
Pipeline #139610 passed
......@@ -14,6 +14,7 @@ Welcome to eossr's documentation!
license
docstring
metadata
notebooks/ossr_statistics.ipynb
examples
snippets
......
%% Cell type:code id:457f7641 tags:
%% Cell type:markdown id:6f9a9077 tags:
# OSSR Statistics
%% Cell type:code id:dbb762f7 tags:
``` python
from eossr.api import get_ossr_records
from eossr.api import get_ossr_records, get_zenodo_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()}"
title = f"## OSSR statistics generated 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
escape2020_community_records = get_zenodo_records(communities='escape2020')
url_escape2020_not_ossr = 'https://zenodo.org/communities/escape2020/search?page=1&size=20&q=&type=publication&type=lesson&type=poster'
text = f"**Note that there are also {len(escape2020_community_records) - len(ossr_records)} records in the `escape2020` community that are not software or datasets.**\n\n"
text += f"You may find them [directly on Zenodo]({url_escape2020_not_ossr})"
```
%% Cell type:code id:696416cf tags:
``` python
md(text)
```
%% Cell type:code id:ae5204cf 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