Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
eossr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ESCAPE2020
WP3
eossr
Commits
11387703
Commit
11387703
authored
3 years ago
by
vuillaut
Browse files
Options
Downloads
Patches
Plain Diff
adding notebook with OSSR global stats
parent
242a8638
No related branches found
No related tags found
1 merge request
!63
adding notebook with OSSR global stats
Pipeline
#139518
passed
3 years ago
Stage: install
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/notebooks/ossr_statistics.ipynb
+91
-0
91 additions, 0 deletions
examples/notebooks/ossr_statistics.ipynb
with
91 additions
and
0 deletions
examples/notebooks/ossr_statistics.ipynb
0 → 100644
+
91
−
0
View file @
11387703
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "457f7641",
"metadata": {},
"outputs": [],
"source": [
"from eossr.api import get_ossr_records\n",
"from IPython.display import Markdown as md\n",
"from datetime import date"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b9668e64",
"metadata": {},
"outputs": [],
"source": [
"title = f\"# OSSR statistics on the {date.today()}\"\n",
"\n",
"ossr_records = get_ossr_records()\n",
"stats_names = ['downloads', 'unique_downloads', 'views', 'unique_views', ]\n",
"sum_stats = {key: sum([int(rec.data['stats'][key]) for rec in ossr_records]) for key in stats_names}\n",
"\n",
"text = f\"## There are {len(ossr_records)} records in the OSSR.\\n\"\n",
"for key, value in sum_stats.items():\n",
" text+=f\"{key.replace('_', ' ')}: {value}\\n\\n\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2f5effcb",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "fe656e0b",
"metadata": {},
"outputs": [],
"source": [
"md(title)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "df351e32",
"metadata": {},
"outputs": [],
"source": [
"md(text)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d0e84058",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% 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
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment