FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docs-es/scripts/pageviews.py at fix_create_issue_script · sofide/python-docs-es · GitHub
sofide
/
python-docs-es
Public
forked from
python/python-docs-es
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docs-es
/
scripts
/
pageviews.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (15 loc) · 674 Bytes
Breadcrumbs
python-docs-es
/
scripts
/
pageviews.py
Copy path
File metadata and controls
18 lines (15 loc) · 674 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from
pprint
import
pprint
results
=
{}
# page-requests-20200504-20200510.txt
# is a file containing stats from pageviews on the official Python documentation
# (including different versions and languages)
# grep -E '\.html$' page-requests-20200504-20200510.txt | grep -v tutorial | sed 's/3\..\///g' | sed 's/3\///g' | sed 's/2\///g' > pageviews.txt
pages
=
open
(
'pageviews.txt'
).
readlines
()[:
-
1
]
for
p
in
pages
:
count
,
key
=
int
(
p
.
split
()[
0
]),
p
.
split
()[
-
1
].
strip
()
if
key
in
results
:
results
[
key
]
+=
count
else
:
results
[
key
]
=
count
for
p
in
sorted
(
list
(
results
.
items
()),
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)[
50
:
100
]:
print
(
p
[
1
],
p
[
0
][
1
:])
Back
|
FazBrowse Home
|
New Git URL