geekbench-browser-python 0.1.10__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. geekbench_browser_python-0.1.10/README.md → geekbench_browser_python-1.0.0/PKG-INFO +44 -40
  2. geekbench_browser_python-1.0.0/README.md +137 -0
  3. geekbench_browser_python-1.0.0/pyproject.toml +58 -0
  4. geekbench_browser_python-1.0.0/setup.cfg +4 -0
  5. {geekbench_browser_python-0.1.10 → geekbench_browser_python-1.0.0}/src/geekbench_browser/__main__.py +8 -18
  6. geekbench_browser_python-1.0.0/src/geekbench_browser/_main.py +48 -0
  7. {geekbench_browser_python-0.1.10 → geekbench_browser_python-1.0.0}/src/geekbench_browser/_option_eat_all.py +5 -4
  8. {geekbench_browser_python-0.1.10 → geekbench_browser_python-1.0.0}/src/geekbench_browser/_rich_table.py +4 -3
  9. {geekbench_browser_python-0.1.10 → geekbench_browser_python-1.0.0/src/geekbench_browser_python.egg-info}/PKG-INFO +33 -63
  10. geekbench_browser_python-1.0.0/src/geekbench_browser_python.egg-info/SOURCES.txt +16 -0
  11. geekbench_browser_python-1.0.0/src/geekbench_browser_python.egg-info/dependency_links.txt +1 -0
  12. geekbench_browser_python-1.0.0/src/geekbench_browser_python.egg-info/entry_points.txt +3 -0
  13. geekbench_browser_python-1.0.0/src/geekbench_browser_python.egg-info/requires.txt +5 -0
  14. geekbench_browser_python-1.0.0/src/geekbench_browser_python.egg-info/top_level.txt +1 -0
  15. geekbench_browser_python-1.0.0/tests/test_main.py +10 -0
  16. geekbench_browser_python-0.1.10/pyproject.toml +0 -108
  17. geekbench_browser_python-0.1.10/src/geekbench_browser/_main.py +0 -40
  18. {geekbench_browser_python-0.1.10 → geekbench_browser_python-1.0.0}/LICENSE +0 -0
  19. {geekbench_browser_python-0.1.10 → geekbench_browser_python-1.0.0}/src/geekbench_browser/__init__.py +0 -0
  20. {geekbench_browser_python-0.1.10 → geekbench_browser_python-1.0.0}/src/geekbench_browser/py.typed +0 -0
@@ -1,3 +1,31 @@
1
+ Metadata-Version: 2.4
2
+ Name: geekbench-browser-python
3
+ Version: 1.0.0
4
+ Summary: Simple package for getting data from browser.geekbench.com
5
+ Author: 34j
6
+ License-Expression: MIT
7
+ Project-URL: Bug Tracker, https://github.com/34j/geekbench-browser-python/issues
8
+ Project-URL: Changelog, https://github.com/34j/geekbench-browser-python/blob/main/CHANGELOG.md
9
+ Project-URL: documentation, https://geekbench-browser-python.readthedocs.io
10
+ Project-URL: repository, https://github.com/34j/geekbench-browser-python
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Natural Language :: English
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Requires-Python: >=3.13
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: click
23
+ Requires-Dist: nodriver>=0.50.99
24
+ Requires-Dist: pandas>=1.5.3
25
+ Requires-Dist: py-cpuinfo>=9
26
+ Requires-Dist: rich>=15
27
+ Dynamic: license-file
28
+
1
29
  # Geekbench Browser Python
2
30
 
3
31
  <p align="center">
@@ -7,19 +35,19 @@
7
35
  <a href="https://geekbench-browser-python.readthedocs.io">
8
36
  <img src="https://img.shields.io/readthedocs/geekbench-browser-python.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
9
37
  </a>
38
+ </p>
39
+ <p align="center">
10
40
  <a href="https://codecov.io/gh/34j/geekbench-browser-python">
11
41
  <img src="https://img.shields.io/codecov/c/github/34j/geekbench-browser-python.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
12
42
  </a>
13
- </p>
14
- <p align="center">
15
- <a href="https://python-poetry.org/">
16
- <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">
43
+ <a href="https://github.com/astral-sh/uv">
44
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
17
45
  </a>
18
- <a href="https://github.com/ambv/black">
19
- <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
46
+ <a href="https://github.com/astral-sh/ruff">
47
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
20
48
  </a>
21
- <a href="https://github.com/pre-commit/pre-commit">
22
- <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
49
+ <a href="https://github.com/j178/prek">
50
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json" alt="prek">
23
51
  </a>
24
52
  </p>
25
53
  <p align="center">
@@ -30,6 +58,14 @@
30
58
  <img src="https://img.shields.io/pypi/l/geekbench-browser-python.svg?style=flat-square" alt="License">
31
59
  </p>
32
60
 
61
+ ---
62
+
63
+ **Documentation**: <a href="https://geekbench-browser-python.readthedocs.io" target="_blank">https://geekbench-browser-python.readthedocs.io </a>
64
+
65
+ **Source Code**: <a href="https://github.com/34j/geekbench-browser-python" target="_blank">https://github.com/34j/geekbench-browser-python </a>
66
+
67
+ ---
68
+
33
69
  Simple package for getting data from [browser.geekbench.com](https://browser.geekbench.com/).
34
70
 
35
71
  ## Installation
@@ -127,35 +163,3 @@ Options:
127
163
  -v, --verbose Verbose output
128
164
  -h, --help Show this message and exit.
129
165
  ```
130
-
131
- ## Contributors ✨
132
-
133
- Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
134
-
135
- <!-- prettier-ignore-start -->
136
- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
137
- <!-- prettier-ignore-start -->
138
- <!-- markdownlint-disable -->
139
- <table>
140
- <tbody>
141
- <tr>
142
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/34j"><img src="https://avatars.githubusercontent.com/u/55338215?v=4?s=80" width="80px;" alt="34j"/><br /><sub><b>34j</b></sub></a><br /><a href="https://github.com/34j/geekbench-browser-python/commits?author=34j" title="Code">💻</a></td>
143
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/shvchk"><img src="https://avatars.githubusercontent.com/u/872945?v=4?s=80" width="80px;" alt="Andrei Shevchuk"/><br /><sub><b>Andrei Shevchuk</b></sub></a><br /><a href="https://github.com/34j/geekbench-browser-python/issues?q=author%3Ashvchk" title="Bug reports">🐛</a> <a href="https://github.com/34j/geekbench-browser-python/commits?author=shvchk" title="Code">💻</a></td>
144
- </tr>
145
- </tbody>
146
- </table>
147
-
148
- <!-- markdownlint-restore -->
149
- <!-- prettier-ignore-end -->
150
-
151
- <!-- ALL-CONTRIBUTORS-LIST:END -->
152
- <!-- prettier-ignore-end -->
153
-
154
- This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
155
-
156
- ## Credits
157
-
158
- This package was created with
159
- [Copier](https://copier.readthedocs.io/) and the
160
- [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
161
- project template.
@@ -0,0 +1,137 @@
1
+ # Geekbench Browser Python
2
+
3
+ <p align="center">
4
+ <a href="https://github.com/34j/geekbench-browser-python/actions/workflows/ci.yml?query=branch%3Amain">
5
+ <img src="https://img.shields.io/github/actions/workflow/status/34j/geekbench-browser-python/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
6
+ </a>
7
+ <a href="https://geekbench-browser-python.readthedocs.io">
8
+ <img src="https://img.shields.io/readthedocs/geekbench-browser-python.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
9
+ </a>
10
+ </p>
11
+ <p align="center">
12
+ <a href="https://codecov.io/gh/34j/geekbench-browser-python">
13
+ <img src="https://img.shields.io/codecov/c/github/34j/geekbench-browser-python.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
14
+ </a>
15
+ <a href="https://github.com/astral-sh/uv">
16
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
17
+ </a>
18
+ <a href="https://github.com/astral-sh/ruff">
19
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
20
+ </a>
21
+ <a href="https://github.com/j178/prek">
22
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json" alt="prek">
23
+ </a>
24
+ </p>
25
+ <p align="center">
26
+ <a href="https://pypi.org/project/geekbench-browser-python/">
27
+ <img src="https://img.shields.io/pypi/v/geekbench-browser-python.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
28
+ </a>
29
+ <img src="https://img.shields.io/pypi/pyversions/geekbench-browser-python.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
30
+ <img src="https://img.shields.io/pypi/l/geekbench-browser-python.svg?style=flat-square" alt="License">
31
+ </p>
32
+
33
+ ---
34
+
35
+ **Documentation**: <a href="https://geekbench-browser-python.readthedocs.io" target="_blank">https://geekbench-browser-python.readthedocs.io </a>
36
+
37
+ **Source Code**: <a href="https://github.com/34j/geekbench-browser-python" target="_blank">https://github.com/34j/geekbench-browser-python </a>
38
+
39
+ ---
40
+
41
+ Simple package for getting data from [browser.geekbench.com](https://browser.geekbench.com/).
42
+
43
+ ## Installation
44
+
45
+ Install this via pip (or your favourite package manager):
46
+
47
+ ```shell
48
+ pip install geekbench-browser-python
49
+ ```
50
+
51
+ ## Usage
52
+
53
+ Both `geekbench-browser` and `gbr` are available as CLI commands. Requests are cached in `~/.cache/geekbench-browser-python` by default and refreshed every 24 hours.
54
+
55
+ - Getting all data
56
+
57
+ ```shell
58
+ $ gbr
59
+ (very long output)
60
+ ```
61
+
62
+ - Getting specific CPU data (Not case sensitive)
63
+
64
+ ```shell
65
+ $ gbr 3600x 3900x
66
+ ┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┓
67
+ ┃ ┃ description ┃ single ┃ multi ┃ icon ┃ family ┃ samples ┃
68
+ ┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━┩
69
+ │ AMD Ryzen 5 3600X │ 3.8 GHz (6 cores) │ 1243 │ 6857 │ amd-ryzen5 │ Matisse │ 9606 │
70
+ │ AMD Ryzen 5 3600XT │ 3.8 GHz (6 cores) │ 1301 │ 7041 │ amd │ Matisse │ 3241 │
71
+ │ AMD Ryzen 9 3900X │ 3.8 GHz (12 cores) │ 1275 │ 11664 │ amd-ryzen9 │ Matisse │ 24420 │
72
+ │ AMD Ryzen 9 3900XT │ 3.8 GHz (12 cores) │ 1316 │ 11958 │ amd │ Matisse │ 3409 │
73
+ └────────────────────┴────────────────────┴────────┴───────┴────────────┴─────────┴─────────┘
74
+ ```
75
+
76
+ - Getting current CPU data and speific CPU data
77
+
78
+ ```shell
79
+ $ gbr current 3900x
80
+ ┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┓
81
+ ┃ ┃ description ┃ single ┃ multi ┃ icon ┃ family ┃ samples ┃
82
+ ┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━┩
83
+ │ AMD Ryzen 9 3900X │ 3.8 GHz (12 cores) │ 1275 │ 11664 │ amd-ryzen9 │ Matisse │ 24420 │
84
+ │ AMD Ryzen 9 3900XT │ 3.8 GHz (12 cores) │ 1316 │ 11958 │ amd │ Matisse │ 3409 │
85
+ │ AMD Ryzen 9 3950X │ 3.5 GHz (16 cores) │ 1295 │ 14127 │ amd-ryzen9 │ Matisse │ 11023 │
86
+ └────────────────────┴────────────────────┴────────┴───────┴────────────┴─────────┴─────────┘
87
+ ```
88
+
89
+ - Sorting by single score
90
+
91
+ ```shell
92
+ $ gbr "ryzen 9" -s single
93
+ ┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━┓
94
+ ┃ ┃ description ┃ single ┃ multi ┃ icon ┃ family ┃ samples ┃
95
+ ┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━┩
96
+ │ AMD Ryzen 9 7950X │ 4.5 GHz (16 cores) │ 2191 │ 23093 │ amd │ Raphael │ 5996 │
97
+ │ AMD Ryzen 9 7900X │ 4.7 GHz (12 cores) │ 2181 │ 19243 │ amd │ Raphael │ 1857 │
98
+ │ AMD Ryzen 9 7900 │ 3.7 GHz (12 cores) │ 2098 │ 17982 │ amd │ Raphael │ 177 │
99
+ │ AMD Ryzen 9 5950X │ 3.4 GHz (16 cores) │ 1682 │ 16439 │ amd │ Vermeer │ 58690 │
100
+ │ AMD Ryzen 9 5900X │ 3.7 GHz (12 cores) │ 1671 │ 13899 │ amd │ Vermeer │ 60238 │
101
+ │ AMD Ryzen 9 5900 │ 3.0 GHz (12 cores) │ 1626 │ 12224 │ amd │ Vermeer │ 345 │
102
+ │ AMD Ryzen 9 6900HX │ 3.3 GHz (8 cores) │ 1513 │ 9174 │ amd │ Rembrandt │ 1639 │
103
+ │ AMD Ryzen 9 6900HS │ 3.3 GHz (8 cores) │ 1416 │ 8479 │ amd │ Rembrandt │ 1696 │
104
+ │ AMD Ryzen 9 5900HX │ 3.3 GHz (8 cores) │ 1410 │ 7640 │ amd │ Cezanne │ 13702 │
105
+ │ AMD Ryzen 9 3900XT │ 3.8 GHz (12 cores) │ 1316 │ 11958 │ amd │ Matisse │ 3409 │
106
+ │ AMD Ryzen 9 3950X │ 3.5 GHz (16 cores) │ 1295 │ 14127 │ amd-ryzen9 │ Matisse │ 11023 │
107
+ │ AMD Ryzen 9 3900X │ 3.8 GHz (12 cores) │ 1275 │ 11664 │ amd-ryzen9 │ Matisse │ 24420 │
108
+ │ AMD Ryzen 9 3900 │ 3.1 GHz (12 cores) │ 1222 │ 10768 │ amd │ Matisse │ 1078 │
109
+ │ AMD Ryzen 9 4900H │ 3.3 GHz (8 cores) │ 1144 │ 6854 │ amd │ Renoir │ 1316 │
110
+ │ AMD Ryzen 9 4900HS │ 3.0 GHz (8 cores) │ 1079 │ 6862 │ amd-ryzen9 │ Renoir │ 4532 │
111
+ └────────────────────┴────────────────────┴────────┴───────┴────────────┴───────────┴─────────┘
112
+ ```
113
+
114
+ - All options
115
+
116
+ ```shell
117
+ $ gbr -h
118
+ Usage: gbr [OPTIONS] [NAMES]...
119
+
120
+ Options:
121
+ -mc, --min-cores INTEGER Minimum number of cores
122
+ -xc, --max-cores INTEGER Maximum number of cores
123
+ -mf, --min-frequency FLOAT Minimum frequency in GHz
124
+ -xf, --max-frequency FLOAT Maximum frequency in GHz
125
+ -ms, --min-single FLOAT Minimum single core score
126
+ -xs, --max-single FLOAT Maximum single core score
127
+ -mm, --min-multi FLOAT Minimum multi core score
128
+ -xm, --max-multi FLOAT Maximum multi core score
129
+ -i, --icon TUPLE Icon to search for
130
+ -f, --family TUPLE Family to search for
131
+ -s, --sort [name|single|multi|frequency|cores|id]
132
+ Sort by (reverse is default except for name,
133
+ id)
134
+ -r, --reverse Reverse the sort order
135
+ -v, --verbose Verbose output
136
+ -h, --help Show this message and exit.
137
+ ```
@@ -0,0 +1,58 @@
1
+ [build-system]
2
+ build-backend = "setuptools.build_meta"
3
+ requires = [ "setuptools>=77.0.3" ]
4
+
5
+ [project]
6
+ name = "geekbench-browser-python"
7
+ version = "1.0.0"
8
+ description = "Simple package for getting data from browser.geekbench.com"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ authors = [
12
+ { name = "34j" },
13
+ ]
14
+ requires-python = ">=3.13"
15
+ classifiers = [
16
+ "Development Status :: 2 - Pre-Alpha",
17
+ "Intended Audience :: Developers",
18
+ "Natural Language :: English",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Topic :: Software Development :: Libraries",
24
+ ]
25
+ dependencies = [
26
+ "click",
27
+ "nodriver>=0.50.99",
28
+ "pandas>=1.5.3",
29
+ "py-cpuinfo>=9",
30
+ "rich>=15",
31
+ ]
32
+ urls."Bug Tracker" = "https://github.com/34j/geekbench-browser-python/issues"
33
+ urls.Changelog = "https://github.com/34j/geekbench-browser-python/blob/main/CHANGELOG.md"
34
+ urls.documentation = "https://geekbench-browser-python.readthedocs.io"
35
+ urls.repository = "https://github.com/34j/geekbench-browser-python"
36
+ scripts.gbr = "geekbench_browser.__main__:cli"
37
+ scripts.geekbench-browser = "geekbench_browser.__main__:cli"
38
+
39
+ [dependency-groups]
40
+ dev = [
41
+ "coverage",
42
+ "packaging-34j[test]>=1.1.8",
43
+ "pytest",
44
+ "pytest-cov",
45
+ "ty",
46
+ ]
47
+ docs = [
48
+ "packaging-34j[docs]",
49
+ ]
50
+
51
+ [tool.ruff]
52
+ extend = ".venv/ruff.toml"
53
+
54
+ [tool.pyproject-fmt]
55
+ max_supported_python = "3.14"
56
+
57
+ [tool.ty]
58
+ terminal.error-on-warning = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,3 +1,5 @@
1
+ # ruff: file-ignore[undocumented-public-function, boolean-type-hint-positional-argument, literal-membership]
2
+
1
3
  from logging import INFO, basicConfig, getLogger
2
4
 
3
5
  import click
@@ -21,9 +23,7 @@ LOG = getLogger(__name__)
21
23
  @click.option("--min-multi", "-mm", type=float, help="Minimum multi core score")
22
24
  @click.option("--max-multi", "-xm", type=float, help="Maximum multi core score")
23
25
  @click.option("--icon", "-i", cls=OptionEatAll, type=tuple, help="Icon to search for")
24
- @click.option(
25
- "--family", "-f", cls=OptionEatAll, type=tuple, help="Family to search for"
26
- )
26
+ @click.option("--family", "-f", cls=OptionEatAll, type=tuple, help="Family to search for")
27
27
  @click.option(
28
28
  "--sort",
29
29
  "-s",
@@ -59,7 +59,7 @@ def cli(
59
59
 
60
60
  # get current cpu name
61
61
  name = cpuinfo.get_cpu_info()["brand_raw"]
62
- LOG.info(f"Current CPU: {name}")
62
+ LOG.info("Current CPU: %s", name)
63
63
 
64
64
  # geekbench cpuname is shorter than cpuinfo brand_raw
65
65
  current_names = data.loc[data["name"].map(lambda x: x in name)]["name"]
@@ -71,9 +71,7 @@ def cli(
71
71
 
72
72
  # filter data
73
73
  if names:
74
- data = data.loc[
75
- data["name"].str.contains("|".join(names), regex=True, case=False)
76
- ]
74
+ data = data.loc[data["name"].str.contains("|".join(names), regex=True, case=False)]
77
75
  if min_cores:
78
76
  data = data.loc[data["cores"] >= min_cores]
79
77
  if max_cores:
@@ -92,15 +90,11 @@ def cli(
92
90
  data = data.loc[data["multi"] <= max_multi]
93
91
  if icon:
94
92
  data = data.loc[
95
- data["icon"]
96
- .astype(str)
97
- .str.contains("|".join(icon), regex=True, case=False)
93
+ data["icon"].astype(str).str.contains("|".join(icon), regex=True, case=False)
98
94
  ]
99
95
  if family:
100
96
  data = data.loc[
101
- data["family"]
102
- .astype(str)
103
- .str.contains("|".join(family), regex=True, case=False)
97
+ data["family"].astype(str).str.contains("|".join(family), regex=True, case=False)
104
98
  ]
105
99
 
106
100
  # sort data
@@ -111,14 +105,10 @@ def cli(
111
105
  # drop columns that does not make sense
112
106
  if not verbose:
113
107
  data = data.drop(columns=["cores", "frequency", "id", "name"])
114
- data = data.reindex(
115
- columns=["description", "single", "multi", "icon", "family", "samples"]
116
- )
108
+ data = data.reindex(columns=["description", "single", "multi", "icon", "family", "samples"])
117
109
 
118
110
  USE_RICH = True
119
111
  if USE_RICH:
120
- import rich
121
- import rich.box
122
112
  import rich.console
123
113
  import rich.table
124
114
 
@@ -0,0 +1,48 @@
1
+ # ruff: file-ignore[pandas-use-of-inplace-argument, unnecessary-assign]
2
+
3
+ import asyncio
4
+ from json import dumps, loads
5
+ from pathlib import Path
6
+ from time import time
7
+
8
+ import nodriver as uc
9
+ from pandas import DataFrame
10
+
11
+ CACHE_PATH = Path.home() / ".cache" / "geekbench_browser"
12
+ CACHE_FILE = CACHE_PATH / "processor-benchmarks.json"
13
+ CACHE_EXPIRE_AFTER = 86400
14
+ GEEKBENCH_URL = "https://browser.geekbench.com/processor-benchmarks.json"
15
+
16
+
17
+ async def _get_json() -> dict:
18
+ browser = await uc.start(
19
+ user_data_dir=CACHE_PATH,
20
+ sandbox=False,
21
+ expert=True,
22
+ )
23
+ try:
24
+ page = await browser.get(GEEKBENCH_URL)
25
+ return loads(await page.evaluate("document.body.innerText", return_by_value=True))
26
+ finally:
27
+ await browser.aclose()
28
+ browser.stop()
29
+
30
+
31
+ def get_data() -> DataFrame:
32
+ if CACHE_FILE.exists() and time() - CACHE_FILE.stat().st_mtime < CACHE_EXPIRE_AFTER:
33
+ json_data = loads(CACHE_FILE.read_bytes())
34
+ else:
35
+ json_data = asyncio.run(_get_json())
36
+ CACHE_PATH.mkdir(parents=True, exist_ok=True)
37
+ CACHE_FILE.write_text(dumps(json_data))
38
+
39
+ df = DataFrame(json_data["devices"])
40
+ df.set_index("name", inplace=True, drop=False)
41
+ df.index.name = None
42
+ df["frequency"] = (
43
+ df["description"].str.extract(r"(\d+\.?\d+) [MG]Hz").astype(float, errors="ignore")
44
+ )
45
+ df.loc[df["description"].str.contains("MHz"), "frequency"] *= 1e-3
46
+ df["cores"] = df["description"].str.extract(r"(\d+) cores").astype(int, errors="ignore")
47
+ df = df.rename(columns={"score": "single", "multicore_score": "multi"})
48
+ return df
@@ -1,8 +1,9 @@
1
+ # ruff: file-ignore[missing-return-type-special-method]
2
+
1
3
  from typing import Any
2
4
 
3
5
  import click
4
- from click import Context, OptionParser
5
- from click.parser import ParsingState
6
+ from click import Context
6
7
 
7
8
 
8
9
  class OptionEatAll(click.Option):
@@ -13,8 +14,8 @@ class OptionEatAll(click.Option):
13
14
  raise ValueError(f"nargs, if set, must be -1 not {nargs}")
14
15
  super().__init__(*args, **kwargs)
15
16
 
16
- def add_to_parser(self, parser: OptionParser, ctx: Context) -> None:
17
- def parser_process(value: str, state: ParsingState) -> None:
17
+ def add_to_parser(self, parser: Any, ctx: Context) -> None:
18
+ def parser_process(value: str, state: Any) -> None:
18
19
  # method to hook to the parser.process
19
20
  done = False
20
21
  values = [value]
@@ -1,4 +1,4 @@
1
- from typing import Optional
1
+ # ruff: file-ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument, pandas-use-of-dot-values]
2
2
 
3
3
  import pandas as pd
4
4
  from rich.table import Table
@@ -8,7 +8,7 @@ def df_to_table(
8
8
  pandas_dataframe: pd.DataFrame,
9
9
  rich_table: Table,
10
10
  show_index: bool = True,
11
- index_name: Optional[str] = None,
11
+ index_name: str | None = None,
12
12
  ) -> Table:
13
13
  """Convert a pandas.DataFrame obj into a rich.Table obj.
14
14
 
@@ -25,8 +25,9 @@ def df_to_table(
25
25
 
26
26
  Returns:
27
27
  Table:
28
- The rich Table instance passed, populated with the DataFrame values."""
28
+ The rich Table instance passed, populated with the DataFrame values.
29
29
 
30
+ """
30
31
  if show_index:
31
32
  index_name = str(index_name) if index_name else ""
32
33
  rich_table.add_column(index_name)
@@ -1,35 +1,30 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: geekbench-browser-python
3
- Version: 0.1.10
3
+ Version: 1.0.0
4
4
  Summary: Simple package for getting data from browser.geekbench.com
5
- Home-page: https://github.com/34j/geekbench-browser-python
6
- License: MIT
7
5
  Author: 34j
8
- Author-email: 34j.95a2p@simplelogin.com
9
- Requires-Python: >=3.8,<4.0
6
+ License-Expression: MIT
7
+ Project-URL: Bug Tracker, https://github.com/34j/geekbench-browser-python/issues
8
+ Project-URL: Changelog, https://github.com/34j/geekbench-browser-python/blob/main/CHANGELOG.md
9
+ Project-URL: documentation, https://geekbench-browser-python.readthedocs.io
10
+ Project-URL: repository, https://github.com/34j/geekbench-browser-python
10
11
  Classifier: Development Status :: 2 - Pre-Alpha
11
12
  Classifier: Intended Audience :: Developers
12
- Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Natural Language :: English
14
14
  Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3 :: Only
21
16
  Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
22
18
  Classifier: Topic :: Software Development :: Libraries
23
- Requires-Dist: click
24
- Requires-Dist: pandas (>=1.3)
25
- Requires-Dist: py-cpuinfo (>=9.0.0,<10.0.0)
26
- Requires-Dist: requests-cache
27
- Requires-Dist: rich (>=13.3.1,<14.0.0)
28
- Project-URL: Bug Tracker, https://github.com/34j/geekbench-browser-python/issues
29
- Project-URL: Changelog, https://github.com/34j/geekbench-browser-python/blob/main/CHANGELOG.md
30
- Project-URL: Documentation, https://geekbench-browser-python.readthedocs.io
31
- Project-URL: Repository, https://github.com/34j/geekbench-browser-python
19
+ Requires-Python: >=3.13
32
20
  Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: click
23
+ Requires-Dist: nodriver>=0.50.99
24
+ Requires-Dist: pandas>=1.5.3
25
+ Requires-Dist: py-cpuinfo>=9
26
+ Requires-Dist: rich>=15
27
+ Dynamic: license-file
33
28
 
34
29
  # Geekbench Browser Python
35
30
 
@@ -40,19 +35,19 @@ Description-Content-Type: text/markdown
40
35
  <a href="https://geekbench-browser-python.readthedocs.io">
41
36
  <img src="https://img.shields.io/readthedocs/geekbench-browser-python.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
42
37
  </a>
38
+ </p>
39
+ <p align="center">
43
40
  <a href="https://codecov.io/gh/34j/geekbench-browser-python">
44
41
  <img src="https://img.shields.io/codecov/c/github/34j/geekbench-browser-python.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
45
42
  </a>
46
- </p>
47
- <p align="center">
48
- <a href="https://python-poetry.org/">
49
- <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">
43
+ <a href="https://github.com/astral-sh/uv">
44
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
50
45
  </a>
51
- <a href="https://github.com/ambv/black">
52
- <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
46
+ <a href="https://github.com/astral-sh/ruff">
47
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
53
48
  </a>
54
- <a href="https://github.com/pre-commit/pre-commit">
55
- <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
49
+ <a href="https://github.com/j178/prek">
50
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json" alt="prek">
56
51
  </a>
57
52
  </p>
58
53
  <p align="center">
@@ -63,6 +58,14 @@ Description-Content-Type: text/markdown
63
58
  <img src="https://img.shields.io/pypi/l/geekbench-browser-python.svg?style=flat-square" alt="License">
64
59
  </p>
65
60
 
61
+ ---
62
+
63
+ **Documentation**: <a href="https://geekbench-browser-python.readthedocs.io" target="_blank">https://geekbench-browser-python.readthedocs.io </a>
64
+
65
+ **Source Code**: <a href="https://github.com/34j/geekbench-browser-python" target="_blank">https://github.com/34j/geekbench-browser-python </a>
66
+
67
+ ---
68
+
66
69
  Simple package for getting data from [browser.geekbench.com](https://browser.geekbench.com/).
67
70
 
68
71
  ## Installation
@@ -160,36 +163,3 @@ Options:
160
163
  -v, --verbose Verbose output
161
164
  -h, --help Show this message and exit.
162
165
  ```
163
-
164
- ## Contributors ✨
165
-
166
- Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
167
-
168
- <!-- prettier-ignore-start -->
169
- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
170
- <!-- prettier-ignore-start -->
171
- <!-- markdownlint-disable -->
172
- <table>
173
- <tbody>
174
- <tr>
175
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/34j"><img src="https://avatars.githubusercontent.com/u/55338215?v=4?s=80" width="80px;" alt="34j"/><br /><sub><b>34j</b></sub></a><br /><a href="https://github.com/34j/geekbench-browser-python/commits?author=34j" title="Code">💻</a></td>
176
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/shvchk"><img src="https://avatars.githubusercontent.com/u/872945?v=4?s=80" width="80px;" alt="Andrei Shevchuk"/><br /><sub><b>Andrei Shevchuk</b></sub></a><br /><a href="https://github.com/34j/geekbench-browser-python/issues?q=author%3Ashvchk" title="Bug reports">🐛</a> <a href="https://github.com/34j/geekbench-browser-python/commits?author=shvchk" title="Code">💻</a></td>
177
- </tr>
178
- </tbody>
179
- </table>
180
-
181
- <!-- markdownlint-restore -->
182
- <!-- prettier-ignore-end -->
183
-
184
- <!-- ALL-CONTRIBUTORS-LIST:END -->
185
- <!-- prettier-ignore-end -->
186
-
187
- This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
188
-
189
- ## Credits
190
-
191
- This package was created with
192
- [Copier](https://copier.readthedocs.io/) and the
193
- [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
194
- project template.
195
-
@@ -0,0 +1,16 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/geekbench_browser/__init__.py
5
+ src/geekbench_browser/__main__.py
6
+ src/geekbench_browser/_main.py
7
+ src/geekbench_browser/_option_eat_all.py
8
+ src/geekbench_browser/_rich_table.py
9
+ src/geekbench_browser/py.typed
10
+ src/geekbench_browser_python.egg-info/PKG-INFO
11
+ src/geekbench_browser_python.egg-info/SOURCES.txt
12
+ src/geekbench_browser_python.egg-info/dependency_links.txt
13
+ src/geekbench_browser_python.egg-info/entry_points.txt
14
+ src/geekbench_browser_python.egg-info/requires.txt
15
+ src/geekbench_browser_python.egg-info/top_level.txt
16
+ tests/test_main.py
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ gbr = geekbench_browser.__main__:cli
3
+ geekbench-browser = geekbench_browser.__main__:cli
@@ -0,0 +1,5 @@
1
+ click
2
+ nodriver>=0.50.99
3
+ pandas>=1.5.3
4
+ py-cpuinfo>=9
5
+ rich>=15
@@ -0,0 +1,10 @@
1
+ import os
2
+
3
+ import pytest
4
+
5
+ from geekbench_browser._main import get_data
6
+
7
+
8
+ @pytest.mark.skipif(bool(os.getenv("CI")), reason="live Geekbench request is disabled in CI")
9
+ def test_get_data():
10
+ get_data()
@@ -1,108 +0,0 @@
1
- [tool.poetry]
2
- name = "geekbench-browser-python"
3
- version = "0.1.10"
4
- description = "Simple package for getting data from browser.geekbench.com"
5
- authors = ["34j <34j.95a2p@simplelogin.com>"]
6
- license = "MIT"
7
- readme = "README.md"
8
- repository = "https://github.com/34j/geekbench-browser-python"
9
- documentation = "https://geekbench-browser-python.readthedocs.io"
10
- classifiers = [
11
- "Development Status :: 2 - Pre-Alpha",
12
- "Intended Audience :: Developers",
13
- "Natural Language :: English",
14
- "Operating System :: OS Independent",
15
- "Topic :: Software Development :: Libraries",
16
- ]
17
- packages = [
18
- { include = "geekbench_browser", from = "src" },
19
- ]
20
-
21
- [tool.poetry.urls]
22
- "Bug Tracker" = "https://github.com/34j/geekbench-browser-python/issues"
23
- "Changelog" = "https://github.com/34j/geekbench-browser-python/blob/main/CHANGELOG.md"
24
-
25
- [tool.poetry.scripts]
26
- gbr = 'geekbench_browser.__main__:cli'
27
- geekbench-browser = 'geekbench_browser.__main__:cli'
28
-
29
- [tool.poetry.dependencies]
30
- python = "^3.8"
31
- requests-cache = "*"
32
- click = "*"
33
- pandas = ">=1.3"
34
- rich = "^13.3.1"
35
- py-cpuinfo = "^9.0.0"
36
-
37
- [tool.poetry.group.dev.dependencies]
38
- pytest = ">=7.0"
39
- pytest-cov = ">=3.0"
40
- black = ">=23.1"
41
- isort = ">=5.12"
42
- autoflake = ">=2.0"
43
-
44
- [tool.poetry.group.docs]
45
- optional = true
46
-
47
- [tool.poetry.group.docs.dependencies]
48
- myst-parser = ">=0.16"
49
- sphinx = ">=4.0"
50
- sphinx-rtd-theme = ">=1.0"
51
-
52
- [tool.semantic_release]
53
- branch = "main"
54
- version_toml = "pyproject.toml:tool.poetry.version"
55
- version_variable = "src/geekbench_browser/__init__.py:__version__"
56
- build_command = "pip install poetry && poetry build"
57
-
58
- [tool.pytest.ini_options]
59
- addopts = "-v -Wdefault --cov=geekbench_browser --cov-report=term-missing:skip-covered"
60
- pythonpath = ["src"]
61
-
62
- [tool.coverage.run]
63
- branch = true
64
-
65
- [tool.coverage.report]
66
- exclude_lines = [
67
- "pragma: no cover",
68
- "@overload",
69
- "if TYPE_CHECKING",
70
- "raise NotImplementedError",
71
- 'if __name__ == "__main__":',
72
- ]
73
-
74
- [tool.isort]
75
- profile = "black"
76
- known_first_party = ["geekbench_browser", "tests"]
77
-
78
- [tool.autoflake]
79
- remove_all_unused_imports = true
80
- remove_unused_variables = true
81
- ignore-init-module-imports = true
82
-
83
- [tool.mypy]
84
- check_untyped_defs = true
85
- disallow_any_generics = true
86
- disallow_incomplete_defs = true
87
- disallow_untyped_defs = true
88
- mypy_path = "src/"
89
- no_implicit_optional = true
90
- show_error_codes = true
91
- warn_unreachable = true
92
- warn_unused_ignores = true
93
- exclude = [
94
- 'docs/.*',
95
- 'setup.py',
96
- ]
97
-
98
- [[tool.mypy.overrides]]
99
- module = "tests.*"
100
- allow_untyped_defs = true
101
-
102
- [[tool.mypy.overrides]]
103
- module = "docs.*"
104
- ignore_errors = true
105
-
106
- [build-system]
107
- requires = ["poetry-core>=1.0.0"]
108
- build-backend = "poetry.core.masonry.api"
@@ -1,40 +0,0 @@
1
- from logging import getLogger
2
- from pathlib import Path
3
-
4
- from pandas import DataFrame
5
- from requests_cache import CachedSession
6
-
7
- LOG = getLogger(__name__)
8
-
9
- CACHE_PATH = Path.home() / ".cache" / "geekbench_browser" / "cache.sqlite"
10
- GEEKBENCH_URL = "https://browser.geekbench.com/processor-benchmarks.json"
11
-
12
-
13
- def get_data() -> DataFrame:
14
- with CachedSession(
15
- CACHE_PATH.as_posix(), backend="sqlite", expire_after=86400
16
- ) as session:
17
- resp = session.get(GEEKBENCH_URL)
18
- LOG.info(
19
- f"Last retrieved: {resp.created_at}, Cache expires: {resp.expires}, "
20
- f"Cache path: {CACHE_PATH}"
21
- )
22
-
23
- json_data = session.get(GEEKBENCH_URL).json()
24
- try:
25
- df = DataFrame(json_data["devices"])
26
- except Exception as e:
27
- raise RuntimeError("Failed to parse json data") from e
28
- df.set_index("name", inplace=True, drop=False)
29
- df.index.name = None
30
- df["frequency"] = (
31
- df["description"]
32
- .str.extract(r"(\d+\.?\d+) [MG]Hz")
33
- .astype(float, errors="ignore")
34
- )
35
- df.loc[df["description"].str.contains("MHz"), "frequency"] *= 1e-3
36
- df["cores"] = (
37
- df["description"].str.extract(r"(\d+) cores").astype(int, errors="ignore")
38
- )
39
- df = df.rename(columns={"score": "single", "multicore_score": "multi"})
40
- return df