ghfind 0.1.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.
- ghfind-0.1.0/.gitignore +7 -0
- ghfind-0.1.0/PKG-INFO +168 -0
- ghfind-0.1.0/README.md +148 -0
- ghfind-0.1.0/ghfind/__init__.py +25 -0
- ghfind-0.1.0/ghfind/_cli.py +424 -0
- ghfind-0.1.0/ghfind/_github.py +1216 -0
- ghfind-0.1.0/ghfind/_score.py +383 -0
- ghfind-0.1.0/ghfind/catalog.py +130 -0
- ghfind-0.1.0/ghfind/client.py +284 -0
- ghfind-0.1.0/ghfind/local.py +61 -0
- ghfind-0.1.0/ghfind/types.py +114 -0
- ghfind-0.1.0/pyproject.toml +38 -0
ghfind-0.1.0/.gitignore
ADDED
ghfind-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ghfind
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official SDK for ghfind.com — score any GitHub account 0-100 for value & trustworthiness (deterministic, no LLM), plus roasts, battles, leaderboards, and developer discovery.
|
|
5
|
+
Project-URL: Homepage, https://ghfind.com
|
|
6
|
+
Project-URL: Documentation, https://ghfind.com/openapi.json
|
|
7
|
+
Project-URL: Repository, https://github.com/hikariming/ghfind
|
|
8
|
+
Project-URL: Issues, https://github.com/hikariming/ghfind/issues
|
|
9
|
+
Author: ghfind
|
|
10
|
+
License-Expression: AGPL-3.0-or-later
|
|
11
|
+
Keywords: agent,ai,contribution,developer-score,ghfind,github,leaderboard,mcp,trust-score
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# ghfind (Python)
|
|
22
|
+
|
|
23
|
+
Official Python SDK **and CLI** for **[ghfind.com](https://ghfind.com)** — score any
|
|
24
|
+
GitHub account **0–100** for value and trustworthiness, with roasts, head-to-head
|
|
25
|
+
battles, leaderboards, and developer discovery.
|
|
26
|
+
|
|
27
|
+
- **Deterministic scoring, no LLM.** `scan`, `score`, `get_score`, and the battle
|
|
28
|
+
winner are pure computation over GitHub data.
|
|
29
|
+
- **Bring your own model.** The only LLM parts are the *roast prose* and *battle
|
|
30
|
+
commentary*. `roast(..., byo_key=...)` runs the LLM through your own
|
|
31
|
+
OpenAI-compatible provider — or just feed the structured `scan()` output to your
|
|
32
|
+
own model.
|
|
33
|
+
- **Score anywhere.** No token → the ghfind server crawls + scores for you. Have a
|
|
34
|
+
token → `ghfind.local` runs the *same* open-source engine entirely on your
|
|
35
|
+
machine (see below). Same numbers either way.
|
|
36
|
+
- **Zero dependencies.** Standard library only.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install ghfind
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## CLI
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
ghfind score torvalds # deterministic score (no auth, cached)
|
|
48
|
+
ghfind roast torvalds --lang en
|
|
49
|
+
ghfind vs torvalds octocat
|
|
50
|
+
ghfind badge torvalds --markdown # a README badge that links back to ghfind
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`score` hits the public **`GET /api/score`** endpoint: no auth, edge-cached and
|
|
54
|
+
rate-limited on the server, and it scores never-seen accounts live (still
|
|
55
|
+
deterministic, no LLM). It's the cheapest path for you *and* for ghfind.
|
|
56
|
+
|
|
57
|
+
| Command | What it does | Endpoint | LLM? |
|
|
58
|
+
| --- | --- | --- | --- |
|
|
59
|
+
| `score <user>` | Deterministic score; prints tier, sub-scores, percentile. | `GET /api/score/{u}` | no |
|
|
60
|
+
| `scan <user>` | Full evidence payload (metrics, signals, red flags). Heavy — needs `--api-key` in prod. | `POST /api/scan` | no |
|
|
61
|
+
| `roast <user>` | Human-facing roast report + AI-adjusted score. | `POST /api/scan` + `/api/roast` | yes\* |
|
|
62
|
+
| `vs <a> <b>` | Head-to-head verdict (winner deterministic). | `POST /api/vs-verdict` | yes\* |
|
|
63
|
+
| `exists <user>` | Does this GitHub login exist? Runs on **your** IP, never touches ghfind. | `api.github.com` | no |
|
|
64
|
+
| `search <query>` | Prefix autocomplete over scored accounts. | `GET /api/search-users` | no |
|
|
65
|
+
| `leaderboard` | Ranked profiles. `--view` / `--window`. | `GET /api/leaderboard` | no |
|
|
66
|
+
| `developers --type language\|org\|repo` | Discover developers by facet. | `GET /api/developers` | no |
|
|
67
|
+
| `stats` | Platform totals. | `GET /api/stats` | no |
|
|
68
|
+
| `badge <user>` | Badge URL, or `--markdown` for a README snippet linking to the profile. | — | no |
|
|
69
|
+
| `card <user>` | OG share-card PNG URL. | — | no |
|
|
70
|
+
| `commands [show <c>]` | Self-describing capability catalog (for agents). | — | no |
|
|
71
|
+
| `auth status` | Show host + which credentials are configured. | — | no |
|
|
72
|
+
|
|
73
|
+
`*` `roast`/`vs` prose is the only LLM part. Pass `--byo-base-url --byo-api-key
|
|
74
|
+
--byo-model` (or `GHFIND_BYO_*` env vars) to run `roast` through your own model
|
|
75
|
+
instead of ghfind's.
|
|
76
|
+
|
|
77
|
+
### Score locally, offline, on your own token
|
|
78
|
+
|
|
79
|
+
`--local` runs the crawl **and** scoring on your machine with your `GITHUB_TOKEN`
|
|
80
|
+
— the ghfind server is never called, so it scales infinitely and never adds load:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
export GITHUB_TOKEN=ghp_xxx
|
|
84
|
+
ghfind score torvalds --local # crawl + score entirely on your machine
|
|
85
|
+
ghfind scan torvalds --local
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Rule of thumb: **have a token → `--local`** (offline, unlimited); **no token →
|
|
89
|
+
plain `score`** (ghfind scores it for you). Output is identical.
|
|
90
|
+
|
|
91
|
+
### Options & environment
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
--host <url> default https://ghfind.com (or GHFIND_HOST)
|
|
95
|
+
--api-key <key> Authorization: Bearer — bypasses Turnstile on POST /api/scan
|
|
96
|
+
(or GHFIND_API_KEY)
|
|
97
|
+
--github-token <t> for --local and exists (or GITHUB_TOKEN)
|
|
98
|
+
--byo-base-url/-api-key/-model your OpenAI-compatible provider for roast
|
|
99
|
+
--json | -o json|pretty|markdown
|
|
100
|
+
--lang zh|en
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Library
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from ghfind import GhFind
|
|
109
|
+
|
|
110
|
+
gh = GhFind() # defaults to https://ghfind.com
|
|
111
|
+
|
|
112
|
+
# Cheapest: deterministic score (no LLM). Works for ANY account —
|
|
113
|
+
# unseen ones are scored live. s["source"] is "indexed" or "live".
|
|
114
|
+
s = gh.get_score("torvalds")
|
|
115
|
+
print(s["final_score"], s["tier"], s["percentile"], s["source"])
|
|
116
|
+
|
|
117
|
+
# Full evidence payload:
|
|
118
|
+
scan = gh.scan("torvalds")
|
|
119
|
+
print(scan["scoring"]["final_score"], scan["scoring"]["red_flags"])
|
|
120
|
+
|
|
121
|
+
# Confirm a handle exists first (on your IP, not ghfind's):
|
|
122
|
+
if gh.user_exists("torvalds"):
|
|
123
|
+
...
|
|
124
|
+
|
|
125
|
+
# Roast with your own model (no ghfind LLM spend):
|
|
126
|
+
roast = gh.roast("torvalds", byo_key={
|
|
127
|
+
"baseURL": "https://api.openai.com/v1", "apiKey": "...", "model": "gpt-4o",
|
|
128
|
+
})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Every method is one atomic capability; introspect them via
|
|
132
|
+
`from ghfind import CATALOG`.
|
|
133
|
+
|
|
134
|
+
### Local scoring (`ghfind.local`)
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import os
|
|
138
|
+
from ghfind.local import collect_and_score
|
|
139
|
+
|
|
140
|
+
scan = collect_and_score("torvalds", token=os.environ["GITHUB_TOKEN"])
|
|
141
|
+
print(scan["scoring"]["final_score"], scan["scoring"]["tier"])
|
|
142
|
+
|
|
143
|
+
# Already have metrics? Score them purely (no I/O):
|
|
144
|
+
from ghfind.local import score_metrics
|
|
145
|
+
scoring = score_metrics(metrics)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
`ghfind.local` is a faithful port of the website's `collect()` + `score()`,
|
|
149
|
+
verified bit-for-bit against the TS/website output. It runs entirely on your own
|
|
150
|
+
machine and GitHub token — no ghfind server, no LLM, no rate limits but GitHub's.
|
|
151
|
+
|
|
152
|
+
### Errors
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from ghfind import GhFindError
|
|
156
|
+
try:
|
|
157
|
+
gh.get_score("someone")
|
|
158
|
+
except GhFindError as e:
|
|
159
|
+
if e.status == 404:
|
|
160
|
+
print("no such GitHub user") # the only 404
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
Machine-readable API spec: <https://ghfind.com/openapi.json> · Agent notes:
|
|
166
|
+
<https://ghfind.com/llms.txt>
|
|
167
|
+
|
|
168
|
+
JS/TS SDK/CLI: [`@hikariming/ghfind` on npm](https://www.npmjs.com/package/@hikariming/ghfind). License: AGPL-3.0-or-later.
|
ghfind-0.1.0/README.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# ghfind (Python)
|
|
2
|
+
|
|
3
|
+
Official Python SDK **and CLI** for **[ghfind.com](https://ghfind.com)** — score any
|
|
4
|
+
GitHub account **0–100** for value and trustworthiness, with roasts, head-to-head
|
|
5
|
+
battles, leaderboards, and developer discovery.
|
|
6
|
+
|
|
7
|
+
- **Deterministic scoring, no LLM.** `scan`, `score`, `get_score`, and the battle
|
|
8
|
+
winner are pure computation over GitHub data.
|
|
9
|
+
- **Bring your own model.** The only LLM parts are the *roast prose* and *battle
|
|
10
|
+
commentary*. `roast(..., byo_key=...)` runs the LLM through your own
|
|
11
|
+
OpenAI-compatible provider — or just feed the structured `scan()` output to your
|
|
12
|
+
own model.
|
|
13
|
+
- **Score anywhere.** No token → the ghfind server crawls + scores for you. Have a
|
|
14
|
+
token → `ghfind.local` runs the *same* open-source engine entirely on your
|
|
15
|
+
machine (see below). Same numbers either way.
|
|
16
|
+
- **Zero dependencies.** Standard library only.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install ghfind
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## CLI
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
ghfind score torvalds # deterministic score (no auth, cached)
|
|
28
|
+
ghfind roast torvalds --lang en
|
|
29
|
+
ghfind vs torvalds octocat
|
|
30
|
+
ghfind badge torvalds --markdown # a README badge that links back to ghfind
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`score` hits the public **`GET /api/score`** endpoint: no auth, edge-cached and
|
|
34
|
+
rate-limited on the server, and it scores never-seen accounts live (still
|
|
35
|
+
deterministic, no LLM). It's the cheapest path for you *and* for ghfind.
|
|
36
|
+
|
|
37
|
+
| Command | What it does | Endpoint | LLM? |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| `score <user>` | Deterministic score; prints tier, sub-scores, percentile. | `GET /api/score/{u}` | no |
|
|
40
|
+
| `scan <user>` | Full evidence payload (metrics, signals, red flags). Heavy — needs `--api-key` in prod. | `POST /api/scan` | no |
|
|
41
|
+
| `roast <user>` | Human-facing roast report + AI-adjusted score. | `POST /api/scan` + `/api/roast` | yes\* |
|
|
42
|
+
| `vs <a> <b>` | Head-to-head verdict (winner deterministic). | `POST /api/vs-verdict` | yes\* |
|
|
43
|
+
| `exists <user>` | Does this GitHub login exist? Runs on **your** IP, never touches ghfind. | `api.github.com` | no |
|
|
44
|
+
| `search <query>` | Prefix autocomplete over scored accounts. | `GET /api/search-users` | no |
|
|
45
|
+
| `leaderboard` | Ranked profiles. `--view` / `--window`. | `GET /api/leaderboard` | no |
|
|
46
|
+
| `developers --type language\|org\|repo` | Discover developers by facet. | `GET /api/developers` | no |
|
|
47
|
+
| `stats` | Platform totals. | `GET /api/stats` | no |
|
|
48
|
+
| `badge <user>` | Badge URL, or `--markdown` for a README snippet linking to the profile. | — | no |
|
|
49
|
+
| `card <user>` | OG share-card PNG URL. | — | no |
|
|
50
|
+
| `commands [show <c>]` | Self-describing capability catalog (for agents). | — | no |
|
|
51
|
+
| `auth status` | Show host + which credentials are configured. | — | no |
|
|
52
|
+
|
|
53
|
+
`*` `roast`/`vs` prose is the only LLM part. Pass `--byo-base-url --byo-api-key
|
|
54
|
+
--byo-model` (or `GHFIND_BYO_*` env vars) to run `roast` through your own model
|
|
55
|
+
instead of ghfind's.
|
|
56
|
+
|
|
57
|
+
### Score locally, offline, on your own token
|
|
58
|
+
|
|
59
|
+
`--local` runs the crawl **and** scoring on your machine with your `GITHUB_TOKEN`
|
|
60
|
+
— the ghfind server is never called, so it scales infinitely and never adds load:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
export GITHUB_TOKEN=ghp_xxx
|
|
64
|
+
ghfind score torvalds --local # crawl + score entirely on your machine
|
|
65
|
+
ghfind scan torvalds --local
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Rule of thumb: **have a token → `--local`** (offline, unlimited); **no token →
|
|
69
|
+
plain `score`** (ghfind scores it for you). Output is identical.
|
|
70
|
+
|
|
71
|
+
### Options & environment
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
--host <url> default https://ghfind.com (or GHFIND_HOST)
|
|
75
|
+
--api-key <key> Authorization: Bearer — bypasses Turnstile on POST /api/scan
|
|
76
|
+
(or GHFIND_API_KEY)
|
|
77
|
+
--github-token <t> for --local and exists (or GITHUB_TOKEN)
|
|
78
|
+
--byo-base-url/-api-key/-model your OpenAI-compatible provider for roast
|
|
79
|
+
--json | -o json|pretty|markdown
|
|
80
|
+
--lang zh|en
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Library
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from ghfind import GhFind
|
|
89
|
+
|
|
90
|
+
gh = GhFind() # defaults to https://ghfind.com
|
|
91
|
+
|
|
92
|
+
# Cheapest: deterministic score (no LLM). Works for ANY account —
|
|
93
|
+
# unseen ones are scored live. s["source"] is "indexed" or "live".
|
|
94
|
+
s = gh.get_score("torvalds")
|
|
95
|
+
print(s["final_score"], s["tier"], s["percentile"], s["source"])
|
|
96
|
+
|
|
97
|
+
# Full evidence payload:
|
|
98
|
+
scan = gh.scan("torvalds")
|
|
99
|
+
print(scan["scoring"]["final_score"], scan["scoring"]["red_flags"])
|
|
100
|
+
|
|
101
|
+
# Confirm a handle exists first (on your IP, not ghfind's):
|
|
102
|
+
if gh.user_exists("torvalds"):
|
|
103
|
+
...
|
|
104
|
+
|
|
105
|
+
# Roast with your own model (no ghfind LLM spend):
|
|
106
|
+
roast = gh.roast("torvalds", byo_key={
|
|
107
|
+
"baseURL": "https://api.openai.com/v1", "apiKey": "...", "model": "gpt-4o",
|
|
108
|
+
})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Every method is one atomic capability; introspect them via
|
|
112
|
+
`from ghfind import CATALOG`.
|
|
113
|
+
|
|
114
|
+
### Local scoring (`ghfind.local`)
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
import os
|
|
118
|
+
from ghfind.local import collect_and_score
|
|
119
|
+
|
|
120
|
+
scan = collect_and_score("torvalds", token=os.environ["GITHUB_TOKEN"])
|
|
121
|
+
print(scan["scoring"]["final_score"], scan["scoring"]["tier"])
|
|
122
|
+
|
|
123
|
+
# Already have metrics? Score them purely (no I/O):
|
|
124
|
+
from ghfind.local import score_metrics
|
|
125
|
+
scoring = score_metrics(metrics)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`ghfind.local` is a faithful port of the website's `collect()` + `score()`,
|
|
129
|
+
verified bit-for-bit against the TS/website output. It runs entirely on your own
|
|
130
|
+
machine and GitHub token — no ghfind server, no LLM, no rate limits but GitHub's.
|
|
131
|
+
|
|
132
|
+
### Errors
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from ghfind import GhFindError
|
|
136
|
+
try:
|
|
137
|
+
gh.get_score("someone")
|
|
138
|
+
except GhFindError as e:
|
|
139
|
+
if e.status == 404:
|
|
140
|
+
print("no such GitHub user") # the only 404
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
Machine-readable API spec: <https://ghfind.com/openapi.json> · Agent notes:
|
|
146
|
+
<https://ghfind.com/llms.txt>
|
|
147
|
+
|
|
148
|
+
JS/TS SDK/CLI: [`@hikariming/ghfind` on npm](https://www.npmjs.com/package/@hikariming/ghfind). License: AGPL-3.0-or-later.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""ghfind — official Python SDK for https://ghfind.com.
|
|
2
|
+
|
|
3
|
+
Score any GitHub account 0-100 for value and trustworthiness (deterministic, no
|
|
4
|
+
LLM), plus roasts, battles, leaderboards, and developer discovery.
|
|
5
|
+
|
|
6
|
+
from ghfind import GhFind
|
|
7
|
+
gh = GhFind()
|
|
8
|
+
print(gh.get_score("torvalds"))
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from .client import DEFAULT_HOST, GhFind, GhFindError
|
|
12
|
+
from .catalog import CATALOG, find_capability
|
|
13
|
+
from .types import TIER_KEY
|
|
14
|
+
|
|
15
|
+
__version__ = "0.1.0"
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"GhFind",
|
|
19
|
+
"GhFindError",
|
|
20
|
+
"DEFAULT_HOST",
|
|
21
|
+
"CATALOG",
|
|
22
|
+
"find_capability",
|
|
23
|
+
"TIER_KEY",
|
|
24
|
+
"__version__",
|
|
25
|
+
]
|