Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Get PyPI packages backends
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Show more breadcrumbs
fconil small programs
Packaging
Get PyPI packages backends
Commits
19166ecc
Commit
19166ecc
authored
1 year ago
by
Françoise Conil
Browse files
Options
Downloads
Patches
Plain Diff
New graphs removing the backends declared less than 5 times
parent
345b0958
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
plot-packaging-backends.py
+18
-8
18 additions, 8 deletions
plot-packaging-backends.py
python-backends-2018-2023-log-scale.png
+0
-0
0 additions, 0 deletions
python-backends-2018-2023-log-scale.png
python-backends-2018-2023.png
+0
-0
0 additions, 0 deletions
python-backends-2018-2023.png
with
18 additions
and
8 deletions
plot-packaging-backends.py
+
18
−
8
View file @
19166ecc
...
@@ -11,19 +11,29 @@ import sqlite3
...
@@ -11,19 +11,29 @@ import sqlite3
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
BACKEND_PATH
=
Path
(
"
~/Progs/python/duckdb/pyproject_backends.db
"
)
BACKEND_PATH
=
Path
(
"
~/Progs/python/duckdb/pyproject_backends.db
"
)
QUERY
=
"
SELECT * FROM backends
"
QUERY_COUNT
=
"
SELECT COUNT(*) AS nb FROM backends WHERE backend IS NOT NULL;
"
# QUERY = "SELECT backend, COUNT(backend) AS nb FROM backends WHERE backend IS NOT NULL GROUP BY backend;"
QUERY
=
"""
SELECT backend, COUNT(backend) AS nb
FROM backends
WHERE backend IS NOT NULL
GROUP BY backend
HAVING COUNT(backend) > 5;
"""
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
cnx
=
sqlite3
.
connect
(
f
"
file:
{
str
(
BACKEND_PATH
.
expanduser
())
}
?mode=ro
"
)
cnx
=
sqlite3
.
connect
(
f
"
file:
{
str
(
BACKEND_PATH
.
expanduser
())
}
?mode=ro
"
)
cnx
.
row_factory
=
sqlite3
.
Row
cnx
.
row_factory
=
sqlite3
.
Row
cur
=
cnx
.
cursor
()
cur
=
cnx
.
cursor
()
cur
.
execute
(
"
SELECT COUNT(*) AS nb FROM backends WHERE backend IS NOT NULL;
"
)
cur
.
execute
(
QUERY_COUNT
)
r
=
cur
.
fetchone
()
r
=
cur
.
fetchone
()
backends_total
=
r
[
'
nb
'
]
backends_total
=
r
[
'
nb
'
]
cur
.
execute
(
"
SELECT backend, COUNT(backend) AS nb FROM backends WHERE backend IS NOT NULL GROUP BY backend;
"
)
cur
.
execute
(
QUERY
)
r
=
cur
.
fetchall
()
r
=
cur
.
fetchall
()
...
@@ -32,12 +42,12 @@ if __name__ == "__main__":
...
@@ -32,12 +42,12 @@ if __name__ == "__main__":
cnx
.
close
()
cnx
.
close
()
fig
=
plt
.
figure
(
num
=
'
Backends on PyPI
'
,
figsize
=
(
12
,
8
))
fig
=
plt
.
figure
(
num
=
'
Backends on PyPI
'
,
figsize
=
(
12
,
8
)
,
dpi
=
600
)
ax
=
fig
.
add_subplot
(
1
,
1
,
1
)
ax
=
fig
.
add_subplot
(
1
,
1
,
1
)
bars
=
ax
.
bar
(
backends
,
backend_nb
,
color
=
[
'
blue
'
if
n
>
500
else
'
cyan
'
for
n
in
backend_nb
])
bars
=
ax
.
bar
(
backends
,
backend_nb
,
color
=
[
'
blue
'
if
n
>
500
else
'
cyan
'
for
n
in
backend_nb
])
ax
.
set_title
(
f
'
{
backends_total
}
backends declared in pyproject.toml on PyPI (2018-2023)
'
)
ax
.
set_title
(
f
'
{
backends_total
}
backends declared in pyproject.toml on PyPI (2018-2023)
, removing nb < 5, log scale
'
)
ax
.
set_xlabel
(
"
Backend
"
)
ax
.
set_xlabel
(
"
Backend
"
)
ax
.
set_ylabel
(
"
Times declared
"
)
ax
.
set_ylabel
(
"
Times declared
"
)
...
@@ -55,7 +65,7 @@ if __name__ == "__main__":
...
@@ -55,7 +65,7 @@ if __name__ == "__main__":
ax
.
text
(
bar
.
get_x
()
+
bar
.
get_width
()
/
2
,
bar
.
get_height
()
+
0.5
,
str
(
nb
),
ha
=
'
center
'
,
va
=
'
bottom
'
)
ax
.
text
(
bar
.
get_x
()
+
bar
.
get_width
()
/
2
,
bar
.
get_height
()
+
0.5
,
str
(
nb
),
ha
=
'
center
'
,
va
=
'
bottom
'
)
# Set logarithmic scale on y-axis
# Set logarithmic scale on y-axis
ax
.
set_yscale
(
'
log
'
)
#
ax.set_yscale('log')
# Color x-axis labels based on the condition
# Color x-axis labels based on the condition
for
label
,
n
in
zip
(
ax
.
get_xticklabels
(),
backend_nb
):
for
label
,
n
in
zip
(
ax
.
get_xticklabels
(),
backend_nb
):
...
@@ -63,8 +73,8 @@ if __name__ == "__main__":
...
@@ -63,8 +73,8 @@ if __name__ == "__main__":
label
.
set_color
(
'
blue
'
)
label
.
set_color
(
'
blue
'
)
# Adjust layout to prevent clipping of rotated labels
# Adjust layout to prevent clipping of rotated labels
#
plt.tight_layout()
plt
.
tight_layout
()
#plt.show()
#plt.show()
plt
.
savefig
(
"
python-backends-2018-2023.png
"
,
dpi
=
600
)
plt
.
savefig
(
"
python-backends-2018-2023.png
"
)
This diff is collapsed.
Click to expand it.
python-backends-2018-2023-log-scale.png
+
0
−
0
View replaced file @
345b0958
View file @
19166ecc
412 KiB
|
W:
|
H:
203 KiB
|
W:
|
H:
2-up
Swipe
Onion skin
This diff is collapsed.
Click to expand it.
python-backends-2018-2023.png
+
0
−
0
View replaced file @
345b0958
View file @
19166ecc
410 KiB
|
W:
|
H:
203 KiB
|
W:
|
H:
2-up
Swipe
Onion skin
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