gitraze 0.2.6__tar.gz → 0.4.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.
- gitraze-0.4.0/PKG-INFO +287 -0
- gitraze-0.4.0/README.md +270 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/__init__.py +1 -1
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/cli.py +11 -6
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/config.py +2 -4
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/core/api_rest.py +6 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/handlers/analyze.py +2 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/handlers/repo.py +8 -1
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/handlers/search.py +8 -1
- gitraze-0.4.0/gitraze/handlers/user.py +21 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/modules/repo.py +19 -2
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/modules/search.py +23 -1
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/modules/user.py +18 -1
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/utils/helpers.py +25 -4
- gitraze-0.4.0/gitraze.egg-info/PKG-INFO +287 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze.egg-info/SOURCES.txt +0 -1
- {gitraze-0.2.6 → gitraze-0.4.0}/pyproject.toml +2 -2
- gitraze-0.2.6/PKG-INFO +0 -226
- gitraze-0.2.6/README.md +0 -209
- gitraze-0.2.6/gitraze/core/api_graphql.py +0 -1
- gitraze-0.2.6/gitraze/handlers/user.py +0 -13
- gitraze-0.2.6/gitraze.egg-info/PKG-INFO +0 -226
- {gitraze-0.2.6 → gitraze-0.4.0}/LICENSE +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/core/__init__.py +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/handlers/__init__.py +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/modules/__init__.py +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/modules/analytics.py +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze/utils/__init__.py +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze.egg-info/dependency_links.txt +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze.egg-info/entry_points.txt +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze.egg-info/requires.txt +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/gitraze.egg-info/top_level.txt +0 -0
- {gitraze-0.2.6 → gitraze-0.4.0}/setup.cfg +0 -0
gitraze-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitraze
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: A CLI and Python library for GitHub exploration, search, and analysis
|
|
5
|
+
Author: AK Pandey
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/akpandey-dev/gitraze
|
|
8
|
+
Keywords: github,cli,api,recon,search,github-user,repository
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: requests
|
|
15
|
+
Requires-Dist: colorama
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# Gitraze
|
|
19
|
+
|
|
20
|
+
> A CLI and Python library for GitHub exploration, search, and analysis
|
|
21
|
+
|
|
22
|
+
Gitraze is a CLI and Python library for exploring, analyzing, and extracting insights from GitHub through the REST API, with GraphQL planned.
|
|
23
|
+
|
|
24
|
+
⚠️ **Status:** Early development — expect bugs, missing features, and rapid changes. APIs and CLI may change without notice.
|
|
25
|
+
|
|
26
|
+
> Built for developers who prefer terminals over tabs.
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/gitraze/)
|
|
29
|
+
[](https://pypi.org/project/gitraze/)
|
|
30
|
+
[](https://pypi.org/project/gitraze/)
|
|
31
|
+
[](https://github.com/akpandey-dev/gitraze/actions)
|
|
32
|
+
[](LICENSE)
|
|
33
|
+
[](https://github.com/akpandey-dev/gitraze/issues)
|
|
34
|
+
[](https://github.com/akpandey-dev/gitraze)
|
|
35
|
+
[](https://github.com/akpandey-dev/gitraze/commits/main)
|
|
36
|
+
[](https://github.com/akpandey-dev/gitraze/graphs/contributors)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Why Gitraze?
|
|
42
|
+
|
|
43
|
+
Most GitHub tools are either slow, bloated, or UI-heavy.
|
|
44
|
+
|
|
45
|
+
**Gitraze is different:**
|
|
46
|
+
- Fast, minimal, no nonsense
|
|
47
|
+
- Built for developers who think in terminals
|
|
48
|
+
- Deep GitHub data access through the REST API
|
|
49
|
+
- Modular and extensible architecture
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Features
|
|
54
|
+
|
|
55
|
+
- Modular system (easy to extend and hack on)
|
|
56
|
+
- CLI-first workflow
|
|
57
|
+
- GitHub API integration through REST; GraphQL planned
|
|
58
|
+
- Repository insights
|
|
59
|
+
- User analysis
|
|
60
|
+
- Filter PRs vs issues automatically
|
|
61
|
+
- Human-readable timestamps
|
|
62
|
+
- Cleaned descriptions (HTML stripped)
|
|
63
|
+
- Analytics modules (in progress)
|
|
64
|
+
- Search users, repos, issues, PRs, and topics
|
|
65
|
+
- Three data formats
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
### From PyPI using `pip`
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install gitraze
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### From source code
|
|
79
|
+
|
|
80
|
+
> Read the `Development setup` section.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
> There may be some gaps between releases on GitHub and PyPI, as multiple commits are sometimes clustered into a single release on PyPI.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## Usage
|
|
87
|
+
|
|
88
|
+
### Run directly from your terminal:
|
|
89
|
+
|
|
90
|
+
Example:
|
|
91
|
+
```bash
|
|
92
|
+
gitraze --version
|
|
93
|
+
gitraze --help
|
|
94
|
+
gitraze user octocat --data-format=raw
|
|
95
|
+
gitraze repo torvalds/linux --data-format=full
|
|
96
|
+
gitraze search repos "machine learning" -n 5 --data-format=compact
|
|
97
|
+
gitraze analyze <target> # Coming soon!
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Example output:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
$ gitraze user octocat
|
|
104
|
+
|
|
105
|
+
[+] Fetching user data...
|
|
106
|
+
[✓] Done
|
|
107
|
+
|
|
108
|
+
User: octocat
|
|
109
|
+
-------------
|
|
110
|
+
Name : The Octocat
|
|
111
|
+
Login : octocat
|
|
112
|
+
Id : 583231
|
|
113
|
+
Node_id : MDQ6VXNlcjU4MzIzMQ==
|
|
114
|
+
Type : User
|
|
115
|
+
User_view_type : public
|
|
116
|
+
Bio : None
|
|
117
|
+
Followers : 22312
|
|
118
|
+
Following : 9
|
|
119
|
+
Public_repos : 8
|
|
120
|
+
Public_gists : 8
|
|
121
|
+
Location : San Francisco
|
|
122
|
+
Profile_url : https://github.com/octocat
|
|
123
|
+
Created_at : 25 Jan 2011
|
|
124
|
+
Email : None
|
|
125
|
+
Twitter_username : None
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
> Commands prefixed with `$` should be run in your terminal.
|
|
130
|
+
|
|
131
|
+
### Gitraze can also be used as a lightweight Python SDK.
|
|
132
|
+
|
|
133
|
+
#### User:
|
|
134
|
+
```python
|
|
135
|
+
import gitraze as gz
|
|
136
|
+
|
|
137
|
+
user = gz.user("octocat", data_format="compact")
|
|
138
|
+
|
|
139
|
+
print(user["name"])
|
|
140
|
+
print(user["followers"])
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### Repository:
|
|
144
|
+
```python
|
|
145
|
+
import gitraze as gz
|
|
146
|
+
|
|
147
|
+
repo = gz.repo("torvalds", "linux", data_format="full")
|
|
148
|
+
|
|
149
|
+
print(repo["name"])
|
|
150
|
+
print(repo["owner"])
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
> Note: Unlike the CLI, the SDK accepts owner and repository name as separate arguments.
|
|
154
|
+
|
|
155
|
+
#### Search:
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
import gitraze as gz
|
|
159
|
+
|
|
160
|
+
results = gz.search(gz.REPOS, "machine learning", 3, data_format="compact")
|
|
161
|
+
|
|
162
|
+
for repo in results:
|
|
163
|
+
print(repo["full_name"])
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Data Formats:
|
|
167
|
+
|
|
168
|
+
All three SDK functions support different data formats:
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
import gitraze as gz
|
|
172
|
+
|
|
173
|
+
user = gz.user("octocat", data_format="full")
|
|
174
|
+
repo = gz.repo("torvalds", "linux", data_format="raw")
|
|
175
|
+
results = gz.search(gz.REPOS, "machine learning", 3, data_format="full")
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### Available options are:
|
|
179
|
+
|
|
180
|
+
* `data_format="compact"`: Returns a concise, human-friendly subset of the most useful fields.
|
|
181
|
+
* `data_format="full"`: Returns all available processed fields exposed by Gitraze.
|
|
182
|
+
* `data_format="raw"`: Returns the raw GitHub API response without filtering or formatting.
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
### Pretty-print results in terminal style:
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
from gitraze import *
|
|
189
|
+
|
|
190
|
+
display(user("octocat"))
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Example output:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
Name : The Octocat
|
|
197
|
+
Login : octocat
|
|
198
|
+
Id : 583231
|
|
199
|
+
Node_id : MDQ6VXNlcjU4MzIzMQ==
|
|
200
|
+
Type : User
|
|
201
|
+
User_view_type : public
|
|
202
|
+
Bio : None
|
|
203
|
+
Followers : 22578
|
|
204
|
+
Following : 9
|
|
205
|
+
Public_repos : 8
|
|
206
|
+
Public_gists : 8
|
|
207
|
+
Location : San Francisco
|
|
208
|
+
Profile_url : https://github.com/octocat
|
|
209
|
+
Created_at : 25 Jan 2011
|
|
210
|
+
Email : None
|
|
211
|
+
Twitter_username : None
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
> Note: **`import gitraze as gz`** is the recommended import.
|
|
215
|
+
|
|
216
|
+
> Note: Exact fields and values may differ from the examples shown, depending on the GitHub API response.
|
|
217
|
+
|
|
218
|
+
## Available exports:
|
|
219
|
+
|
|
220
|
+
### Functions:
|
|
221
|
+
|
|
222
|
+
- `user(username, data_format="compact")`
|
|
223
|
+
- `repo(owner, repo, data_format="compact")`
|
|
224
|
+
- `search(category, query, limit=1, data_format="compact")`
|
|
225
|
+
- `display(data)`
|
|
226
|
+
|
|
227
|
+
### Constants:
|
|
228
|
+
|
|
229
|
+
- `USERS`
|
|
230
|
+
- `REPOS`
|
|
231
|
+
- `PRS`
|
|
232
|
+
- `ISSUES`
|
|
233
|
+
- `TOPICS`
|
|
234
|
+
|
|
235
|
+
> Constants depend on the module internals and may change without prior notice.
|
|
236
|
+
|
|
237
|
+
> CLI commands and SDK APIs are still evolving and may change between releases.
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
## Philosophy
|
|
241
|
+
|
|
242
|
+
Gitraze is built for speed, clarity, and control.
|
|
243
|
+
|
|
244
|
+
No clutter, no distractions — just raw access to GitHub data, the way it should be.
|
|
245
|
+
|
|
246
|
+
If you live in the terminal, Gitraze lives with you.
|
|
247
|
+
|
|
248
|
+
## Development Setup
|
|
249
|
+
|
|
250
|
+
Clone the repo and install locally:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
git clone https://github.com/akpandey-dev/gitraze.git
|
|
254
|
+
cd gitraze
|
|
255
|
+
pip install -e .
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Project Status
|
|
259
|
+
|
|
260
|
+
Gitraze is in active development:
|
|
261
|
+
|
|
262
|
+
- Expect breaking changes
|
|
263
|
+
- Some commands may not work
|
|
264
|
+
- Features are being added rapidly
|
|
265
|
+
- GraphQL is not implemented yet; Gitraze is REST-focused for now.
|
|
266
|
+
|
|
267
|
+
If you're here early — you're basically a beta tester.
|
|
268
|
+
|
|
269
|
+
## Contributing
|
|
270
|
+
|
|
271
|
+
PRs, ideas, bug reports, and feature suggestions are welcome.
|
|
272
|
+
If you want to improve or modify Gitraze, go ahead.
|
|
273
|
+
* Fork the repository
|
|
274
|
+
* Create a feature branch
|
|
275
|
+
* Submit a PR with clean commit messages
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
git checkout -b feature/cool-thing
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Just keep the code clean and the terminal fast.
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
## License
|
|
285
|
+
|
|
286
|
+
MIT License — do whatever you want, just don’t blame me if you break stuff.
|
|
287
|
+
|
gitraze-0.4.0/README.md
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Gitraze
|
|
2
|
+
|
|
3
|
+
> A CLI and Python library for GitHub exploration, search, and analysis
|
|
4
|
+
|
|
5
|
+
Gitraze is a CLI and Python library for exploring, analyzing, and extracting insights from GitHub through the REST API, with GraphQL planned.
|
|
6
|
+
|
|
7
|
+
⚠️ **Status:** Early development — expect bugs, missing features, and rapid changes. APIs and CLI may change without notice.
|
|
8
|
+
|
|
9
|
+
> Built for developers who prefer terminals over tabs.
|
|
10
|
+
|
|
11
|
+
[](https://pypi.org/project/gitraze/)
|
|
12
|
+
[](https://pypi.org/project/gitraze/)
|
|
13
|
+
[](https://pypi.org/project/gitraze/)
|
|
14
|
+
[](https://github.com/akpandey-dev/gitraze/actions)
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
[](https://github.com/akpandey-dev/gitraze/issues)
|
|
17
|
+
[](https://github.com/akpandey-dev/gitraze)
|
|
18
|
+
[](https://github.com/akpandey-dev/gitraze/commits/main)
|
|
19
|
+
[](https://github.com/akpandey-dev/gitraze/graphs/contributors)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Why Gitraze?
|
|
25
|
+
|
|
26
|
+
Most GitHub tools are either slow, bloated, or UI-heavy.
|
|
27
|
+
|
|
28
|
+
**Gitraze is different:**
|
|
29
|
+
- Fast, minimal, no nonsense
|
|
30
|
+
- Built for developers who think in terminals
|
|
31
|
+
- Deep GitHub data access through the REST API
|
|
32
|
+
- Modular and extensible architecture
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Features
|
|
37
|
+
|
|
38
|
+
- Modular system (easy to extend and hack on)
|
|
39
|
+
- CLI-first workflow
|
|
40
|
+
- GitHub API integration through REST; GraphQL planned
|
|
41
|
+
- Repository insights
|
|
42
|
+
- User analysis
|
|
43
|
+
- Filter PRs vs issues automatically
|
|
44
|
+
- Human-readable timestamps
|
|
45
|
+
- Cleaned descriptions (HTML stripped)
|
|
46
|
+
- Analytics modules (in progress)
|
|
47
|
+
- Search users, repos, issues, PRs, and topics
|
|
48
|
+
- Three data formats
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
### From PyPI using `pip`
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install gitraze
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### From source code
|
|
62
|
+
|
|
63
|
+
> Read the `Development setup` section.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
> There may be some gaps between releases on GitHub and PyPI, as multiple commits are sometimes clustered into a single release on PyPI.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
### Run directly from your terminal:
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
```bash
|
|
75
|
+
gitraze --version
|
|
76
|
+
gitraze --help
|
|
77
|
+
gitraze user octocat --data-format=raw
|
|
78
|
+
gitraze repo torvalds/linux --data-format=full
|
|
79
|
+
gitraze search repos "machine learning" -n 5 --data-format=compact
|
|
80
|
+
gitraze analyze <target> # Coming soon!
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Example output:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
$ gitraze user octocat
|
|
87
|
+
|
|
88
|
+
[+] Fetching user data...
|
|
89
|
+
[✓] Done
|
|
90
|
+
|
|
91
|
+
User: octocat
|
|
92
|
+
-------------
|
|
93
|
+
Name : The Octocat
|
|
94
|
+
Login : octocat
|
|
95
|
+
Id : 583231
|
|
96
|
+
Node_id : MDQ6VXNlcjU4MzIzMQ==
|
|
97
|
+
Type : User
|
|
98
|
+
User_view_type : public
|
|
99
|
+
Bio : None
|
|
100
|
+
Followers : 22312
|
|
101
|
+
Following : 9
|
|
102
|
+
Public_repos : 8
|
|
103
|
+
Public_gists : 8
|
|
104
|
+
Location : San Francisco
|
|
105
|
+
Profile_url : https://github.com/octocat
|
|
106
|
+
Created_at : 25 Jan 2011
|
|
107
|
+
Email : None
|
|
108
|
+
Twitter_username : None
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
> Commands prefixed with `$` should be run in your terminal.
|
|
113
|
+
|
|
114
|
+
### Gitraze can also be used as a lightweight Python SDK.
|
|
115
|
+
|
|
116
|
+
#### User:
|
|
117
|
+
```python
|
|
118
|
+
import gitraze as gz
|
|
119
|
+
|
|
120
|
+
user = gz.user("octocat", data_format="compact")
|
|
121
|
+
|
|
122
|
+
print(user["name"])
|
|
123
|
+
print(user["followers"])
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### Repository:
|
|
127
|
+
```python
|
|
128
|
+
import gitraze as gz
|
|
129
|
+
|
|
130
|
+
repo = gz.repo("torvalds", "linux", data_format="full")
|
|
131
|
+
|
|
132
|
+
print(repo["name"])
|
|
133
|
+
print(repo["owner"])
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
> Note: Unlike the CLI, the SDK accepts owner and repository name as separate arguments.
|
|
137
|
+
|
|
138
|
+
#### Search:
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
import gitraze as gz
|
|
142
|
+
|
|
143
|
+
results = gz.search(gz.REPOS, "machine learning", 3, data_format="compact")
|
|
144
|
+
|
|
145
|
+
for repo in results:
|
|
146
|
+
print(repo["full_name"])
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Data Formats:
|
|
150
|
+
|
|
151
|
+
All three SDK functions support different data formats:
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
import gitraze as gz
|
|
155
|
+
|
|
156
|
+
user = gz.user("octocat", data_format="full")
|
|
157
|
+
repo = gz.repo("torvalds", "linux", data_format="raw")
|
|
158
|
+
results = gz.search(gz.REPOS, "machine learning", 3, data_format="full")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### Available options are:
|
|
162
|
+
|
|
163
|
+
* `data_format="compact"`: Returns a concise, human-friendly subset of the most useful fields.
|
|
164
|
+
* `data_format="full"`: Returns all available processed fields exposed by Gitraze.
|
|
165
|
+
* `data_format="raw"`: Returns the raw GitHub API response without filtering or formatting.
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
### Pretty-print results in terminal style:
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
from gitraze import *
|
|
172
|
+
|
|
173
|
+
display(user("octocat"))
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Example output:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
Name : The Octocat
|
|
180
|
+
Login : octocat
|
|
181
|
+
Id : 583231
|
|
182
|
+
Node_id : MDQ6VXNlcjU4MzIzMQ==
|
|
183
|
+
Type : User
|
|
184
|
+
User_view_type : public
|
|
185
|
+
Bio : None
|
|
186
|
+
Followers : 22578
|
|
187
|
+
Following : 9
|
|
188
|
+
Public_repos : 8
|
|
189
|
+
Public_gists : 8
|
|
190
|
+
Location : San Francisco
|
|
191
|
+
Profile_url : https://github.com/octocat
|
|
192
|
+
Created_at : 25 Jan 2011
|
|
193
|
+
Email : None
|
|
194
|
+
Twitter_username : None
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
> Note: **`import gitraze as gz`** is the recommended import.
|
|
198
|
+
|
|
199
|
+
> Note: Exact fields and values may differ from the examples shown, depending on the GitHub API response.
|
|
200
|
+
|
|
201
|
+
## Available exports:
|
|
202
|
+
|
|
203
|
+
### Functions:
|
|
204
|
+
|
|
205
|
+
- `user(username, data_format="compact")`
|
|
206
|
+
- `repo(owner, repo, data_format="compact")`
|
|
207
|
+
- `search(category, query, limit=1, data_format="compact")`
|
|
208
|
+
- `display(data)`
|
|
209
|
+
|
|
210
|
+
### Constants:
|
|
211
|
+
|
|
212
|
+
- `USERS`
|
|
213
|
+
- `REPOS`
|
|
214
|
+
- `PRS`
|
|
215
|
+
- `ISSUES`
|
|
216
|
+
- `TOPICS`
|
|
217
|
+
|
|
218
|
+
> Constants depend on the module internals and may change without prior notice.
|
|
219
|
+
|
|
220
|
+
> CLI commands and SDK APIs are still evolving and may change between releases.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
## Philosophy
|
|
224
|
+
|
|
225
|
+
Gitraze is built for speed, clarity, and control.
|
|
226
|
+
|
|
227
|
+
No clutter, no distractions — just raw access to GitHub data, the way it should be.
|
|
228
|
+
|
|
229
|
+
If you live in the terminal, Gitraze lives with you.
|
|
230
|
+
|
|
231
|
+
## Development Setup
|
|
232
|
+
|
|
233
|
+
Clone the repo and install locally:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
git clone https://github.com/akpandey-dev/gitraze.git
|
|
237
|
+
cd gitraze
|
|
238
|
+
pip install -e .
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Project Status
|
|
242
|
+
|
|
243
|
+
Gitraze is in active development:
|
|
244
|
+
|
|
245
|
+
- Expect breaking changes
|
|
246
|
+
- Some commands may not work
|
|
247
|
+
- Features are being added rapidly
|
|
248
|
+
- GraphQL is not implemented yet; Gitraze is REST-focused for now.
|
|
249
|
+
|
|
250
|
+
If you're here early — you're basically a beta tester.
|
|
251
|
+
|
|
252
|
+
## Contributing
|
|
253
|
+
|
|
254
|
+
PRs, ideas, bug reports, and feature suggestions are welcome.
|
|
255
|
+
If you want to improve or modify Gitraze, go ahead.
|
|
256
|
+
* Fork the repository
|
|
257
|
+
* Create a feature branch
|
|
258
|
+
* Submit a PR with clean commit messages
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
git checkout -b feature/cool-thing
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Just keep the code clean and the terminal fast.
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
## License
|
|
268
|
+
|
|
269
|
+
MIT License — do whatever you want, just don’t blame me if you break stuff.
|
|
270
|
+
|
|
@@ -6,41 +6,46 @@ from gitraze.handlers.analyze import handle_analysis
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def main():
|
|
9
|
+
"""Parse CLI arguments and dispatch the selected command."""
|
|
10
|
+
|
|
9
11
|
parser = argparse.ArgumentParser(
|
|
10
12
|
prog="gitraze",
|
|
11
|
-
description="
|
|
13
|
+
description="Gitraze CLI Tool"
|
|
12
14
|
)
|
|
13
15
|
|
|
14
16
|
# Global flag
|
|
15
17
|
parser.add_argument(
|
|
16
18
|
"--version",
|
|
17
19
|
action="version",
|
|
18
|
-
version="gitraze 0.
|
|
20
|
+
version="gitraze 0.4.0"
|
|
19
21
|
)
|
|
20
22
|
|
|
21
23
|
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
22
24
|
|
|
23
|
-
#
|
|
25
|
+
# USER
|
|
24
26
|
user_parser = subparsers.add_parser("user", help="Fetch user info (GitHub username)")
|
|
25
27
|
user_parser.add_argument("username", help="Format: username")
|
|
28
|
+
user_parser.add_argument("--data-format", choices=["compact", "full", "raw"], default="compact", help="Data format (default: compact)")
|
|
26
29
|
user_parser.set_defaults(func=handle_user)
|
|
27
30
|
|
|
28
31
|
|
|
29
|
-
#
|
|
32
|
+
# REPO
|
|
30
33
|
repo_parser = subparsers.add_parser("repo", help="Fetch repo info (Repository in owner/repo format)")
|
|
31
34
|
repo_parser.add_argument("repo", help="Format: owner/repo")
|
|
35
|
+
repo_parser.add_argument("--data-format", choices=["compact", "full", "raw"], default="compact", help="Data format (default: compact)")
|
|
32
36
|
repo_parser.set_defaults(func=handle_repo)
|
|
33
37
|
|
|
34
38
|
|
|
35
|
-
#
|
|
39
|
+
# SEARCH
|
|
36
40
|
search_parser = subparsers.add_parser("search", help="Search GitHub")
|
|
37
41
|
search_parser.add_argument("category",choices=["repos", "users", "issues", "prs", "topics"],help="repos | users | issues | prs | topics")
|
|
38
42
|
search_parser.add_argument("query", nargs="+", help="Search category (repos, users, issues, topics)")
|
|
39
43
|
search_parser.add_argument("-n", "--limit", type=int, default=1, help="Number of results to show")
|
|
44
|
+
search_parser.add_argument("--data-format", choices=["compact", "full", "raw"], default="compact", help="Data format (default: compact)")
|
|
40
45
|
search_parser.set_defaults(func=handle_search)
|
|
41
46
|
|
|
42
47
|
|
|
43
|
-
#
|
|
48
|
+
# ANALYZE
|
|
44
49
|
analyze_parser = subparsers.add_parser("analyze", help="Analyze target")
|
|
45
50
|
analyze_parser.add_argument("target", nargs="+")
|
|
46
51
|
analyze_parser.set_defaults(func=handle_analysis)
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
# config.py
|
|
2
1
|
|
|
3
|
-
'''=============REST=============='''
|
|
4
2
|
|
|
5
|
-
#
|
|
3
|
+
# BASE CONFIGS
|
|
6
4
|
REST_BASE_URL = "https://api.github.com"
|
|
7
5
|
GRAPHQL_URL = "https://api.github.com/graphql"
|
|
8
6
|
DEFAULT_TIMEOUT = 10
|
|
9
7
|
DEFAULT_HEADERS = {
|
|
10
8
|
"Accept": "application/vnd.github+json"}
|
|
11
9
|
|
|
12
|
-
#
|
|
10
|
+
# SEARCH CATEGORIES CONFIG
|
|
13
11
|
SEARCH_MAP = {
|
|
14
12
|
"repos": "repositories",
|
|
15
13
|
"users": "users",
|
|
@@ -4,6 +4,8 @@ from gitraze.config import REST_BASE_URL, DEFAULT_HEADERS, DEFAULT_TIMEOUT
|
|
|
4
4
|
from gitraze.config import SEARCH_MAP
|
|
5
5
|
|
|
6
6
|
def get_user(username):
|
|
7
|
+
"""Fetch raw user data from the GitHub REST API."""
|
|
8
|
+
|
|
7
9
|
url = f"{REST_BASE_URL}/users/{username}"
|
|
8
10
|
|
|
9
11
|
try:
|
|
@@ -23,6 +25,8 @@ def get_user(username):
|
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
def get_repo(owner, repo):
|
|
28
|
+
"""Fetch raw repository data from the GitHub REST API."""
|
|
29
|
+
|
|
26
30
|
url = f"{REST_BASE_URL}/repos/{owner}/{repo}"
|
|
27
31
|
try:
|
|
28
32
|
response = requests.get(
|
|
@@ -40,6 +44,8 @@ def get_repo(owner, repo):
|
|
|
40
44
|
return {"error": f"Request failed: {str(e)}"}
|
|
41
45
|
|
|
42
46
|
def get_search(category, query):
|
|
47
|
+
"""Fetch raw search results from the GitHub REST API."""
|
|
48
|
+
|
|
43
49
|
url = f"{REST_BASE_URL}/search/{SEARCH_MAP.get(category)}"
|
|
44
50
|
|
|
45
51
|
filters = []
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import json
|
|
1
2
|
from gitraze.utils.helpers import pretty_print
|
|
2
3
|
from gitraze.modules.repo import get_repo_rest
|
|
3
4
|
|
|
4
5
|
def handle_repo(args):
|
|
6
|
+
"""Handle the repo CLI command."""
|
|
7
|
+
|
|
5
8
|
print("[+] Fetching repository data...")
|
|
6
9
|
parts = args.repo.split("/")
|
|
7
10
|
|
|
@@ -9,11 +12,15 @@ def handle_repo(args):
|
|
|
9
12
|
print("Invalid format. Use: owner/repo")
|
|
10
13
|
return
|
|
11
14
|
owner, repo = parts
|
|
12
|
-
data = get_repo_rest(owner, repo)
|
|
15
|
+
data = get_repo_rest(owner, repo, data_format=args.data_format)
|
|
13
16
|
|
|
14
17
|
if "error" in data:
|
|
15
18
|
print(data["error"])
|
|
16
19
|
return
|
|
17
20
|
|
|
18
21
|
print("[✓] Done")
|
|
22
|
+
|
|
23
|
+
if args.data_format == "raw":
|
|
24
|
+
print(json.dumps(data, indent=2))
|
|
25
|
+
return
|
|
19
26
|
pretty_print(data, title=f"User: {owner}, Repository: {repo}")
|