gitraze 0.2.3__tar.gz → 0.2.5__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 (30) hide show
  1. {gitraze-0.2.3 → gitraze-0.2.5}/PKG-INFO +82 -5
  2. {gitraze-0.2.3 → gitraze-0.2.5}/README.md +81 -4
  3. gitraze-0.2.5/gitraze/__init__.py +25 -0
  4. gitraze-0.2.5/gitraze/cli.py +61 -0
  5. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/config.py +2 -9
  6. gitraze-0.2.5/gitraze/handlers/analyze.py +7 -0
  7. gitraze-0.2.5/gitraze/handlers/repo.py +19 -0
  8. gitraze-0.2.5/gitraze/handlers/search.py +26 -0
  9. gitraze-0.2.5/gitraze/handlers/user.py +13 -0
  10. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze.egg-info/PKG-INFO +82 -5
  11. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze.egg-info/SOURCES.txt +5 -0
  12. {gitraze-0.2.3 → gitraze-0.2.5}/pyproject.toml +1 -1
  13. gitraze-0.2.3/gitraze/cli.py +0 -116
  14. {gitraze-0.2.3 → gitraze-0.2.5}/LICENSE +0 -0
  15. {gitraze-0.2.3/gitraze → gitraze-0.2.5/gitraze/core}/__init__.py +0 -0
  16. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/core/api_graphql.py +0 -0
  17. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/core/api_rest.py +0 -0
  18. {gitraze-0.2.3/gitraze/core → gitraze-0.2.5/gitraze/handlers}/__init__.py +0 -0
  19. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/modules/__init__.py +0 -0
  20. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/modules/analytics.py +0 -0
  21. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/modules/repo.py +0 -0
  22. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/modules/search.py +0 -0
  23. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/modules/user.py +0 -0
  24. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/utils/__init__.py +0 -0
  25. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze/utils/helpers.py +0 -0
  26. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze.egg-info/dependency_links.txt +0 -0
  27. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze.egg-info/entry_points.txt +0 -0
  28. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze.egg-info/requires.txt +0 -0
  29. {gitraze-0.2.3 → gitraze-0.2.5}/gitraze.egg-info/top_level.txt +0 -0
  30. {gitraze-0.2.3 → gitraze-0.2.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitraze
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: A CLI and Python library for GitHub reconnaissance, search, and analysis
5
5
  Author: AK Pandey
6
6
  License-Expression: MIT
@@ -65,7 +65,7 @@ pip install gitraze
65
65
 
66
66
  ## Usage
67
67
 
68
- Run directly from your terminal:
68
+ ### Run directly from your terminal:
69
69
 
70
70
  Example:
71
71
  ```bash
@@ -103,14 +103,79 @@ Email : None
103
103
  Twitter_username : None
104
104
 
105
105
  ```
106
- > 💡 Commands prefixed with `$` should be run in your terminal.
106
+ > Commands prefixed with `$` should be run in your terminal.
107
107
 
108
- You can also use it inside Python:
108
+ ### Gitraze can also be used as a lightweight Python SDK.
109
109
 
110
+ #### User:
110
111
  ```python
111
- import gitraze
112
+ import gitraze as gz
113
+
114
+ user = gz.user("octocat")
115
+
116
+ print(user["name"])
117
+ print(user["followers"])
118
+ ```
119
+
120
+ #### Search:
121
+
122
+ ```python
123
+ results = gz.search(gz.REPOS, "machine learning", 3)
124
+
125
+ for repo in results:
126
+ print(repo["full_name"])
127
+ ```
128
+
129
+ ### Pretty-print results in terminal style:
130
+
131
+ ```python
132
+ from gitraze import *
133
+
134
+ display(user("octocat"))
112
135
  ```
113
136
 
137
+ Example output:
138
+
139
+ ```bash
140
+ Name : The Octocat
141
+ Login : octocat
142
+ Id : 583231
143
+ Node_id : MDQ6VXNlcjU4MzIzMQ==
144
+ Type : User
145
+ User_view_type : public
146
+ Bio : None
147
+ Followers : 22578
148
+ Following : 9
149
+ Public_repos : 8
150
+ Public_gists : 8
151
+ Location : San Francisco
152
+ Profile_url : https://github.com/octocat
153
+ Created_at : 25 Jan 2011
154
+ Email : None
155
+ Twitter_username : None
156
+ ```
157
+
158
+ > Note: **`import gitraze as gz`** is the recommended import.
159
+
160
+ ## Available exports:
161
+
162
+ ### Functions:
163
+
164
+ - `user()`
165
+ - `repo()`
166
+ - `search()`
167
+ - `display()`
168
+
169
+ ### Constants:
170
+
171
+ - `USERS`
172
+ - `REPOS`
173
+ - `PRS`
174
+ - `ISSUES`
175
+ - `TOPICS`
176
+
177
+
178
+
114
179
  ⚠️ CLI commands are still evolving and may change.
115
180
 
116
181
  ## Philosophy
@@ -143,6 +208,18 @@ Gitraze is in active development:
143
208
 
144
209
  If you're here early — you're basically a beta tester 😈
145
210
 
211
+ ## Contributing
212
+
213
+ PRs, ideas, bug reports, and feature suggestions are welcome.
214
+ If you want to improve or modify Gitraze, go ahead.
215
+
216
+ ```bash
217
+ git checkout -b feature/cool-thing
218
+ ```
219
+
220
+ Just keep the code clean and the terminal fast.
221
+
222
+
146
223
  ## License
147
224
 
148
225
  MIT License — do whatever you want, just don’t blame me if you break stuff.
@@ -48,7 +48,7 @@ pip install gitraze
48
48
 
49
49
  ## Usage
50
50
 
51
- Run directly from your terminal:
51
+ ### Run directly from your terminal:
52
52
 
53
53
  Example:
54
54
  ```bash
@@ -86,14 +86,79 @@ Email : None
86
86
  Twitter_username : None
87
87
 
88
88
  ```
89
- > 💡 Commands prefixed with `$` should be run in your terminal.
89
+ > Commands prefixed with `$` should be run in your terminal.
90
90
 
91
- You can also use it inside Python:
91
+ ### Gitraze can also be used as a lightweight Python SDK.
92
92
 
93
+ #### User:
93
94
  ```python
94
- import gitraze
95
+ import gitraze as gz
96
+
97
+ user = gz.user("octocat")
98
+
99
+ print(user["name"])
100
+ print(user["followers"])
101
+ ```
102
+
103
+ #### Search:
104
+
105
+ ```python
106
+ results = gz.search(gz.REPOS, "machine learning", 3)
107
+
108
+ for repo in results:
109
+ print(repo["full_name"])
110
+ ```
111
+
112
+ ### Pretty-print results in terminal style:
113
+
114
+ ```python
115
+ from gitraze import *
116
+
117
+ display(user("octocat"))
95
118
  ```
96
119
 
120
+ Example output:
121
+
122
+ ```bash
123
+ Name : The Octocat
124
+ Login : octocat
125
+ Id : 583231
126
+ Node_id : MDQ6VXNlcjU4MzIzMQ==
127
+ Type : User
128
+ User_view_type : public
129
+ Bio : None
130
+ Followers : 22578
131
+ Following : 9
132
+ Public_repos : 8
133
+ Public_gists : 8
134
+ Location : San Francisco
135
+ Profile_url : https://github.com/octocat
136
+ Created_at : 25 Jan 2011
137
+ Email : None
138
+ Twitter_username : None
139
+ ```
140
+
141
+ > Note: **`import gitraze as gz`** is the recommended import.
142
+
143
+ ## Available exports:
144
+
145
+ ### Functions:
146
+
147
+ - `user()`
148
+ - `repo()`
149
+ - `search()`
150
+ - `display()`
151
+
152
+ ### Constants:
153
+
154
+ - `USERS`
155
+ - `REPOS`
156
+ - `PRS`
157
+ - `ISSUES`
158
+ - `TOPICS`
159
+
160
+
161
+
97
162
  ⚠️ CLI commands are still evolving and may change.
98
163
 
99
164
  ## Philosophy
@@ -126,6 +191,18 @@ Gitraze is in active development:
126
191
 
127
192
  If you're here early — you're basically a beta tester 😈
128
193
 
194
+ ## Contributing
195
+
196
+ PRs, ideas, bug reports, and feature suggestions are welcome.
197
+ If you want to improve or modify Gitraze, go ahead.
198
+
199
+ ```bash
200
+ git checkout -b feature/cool-thing
201
+ ```
202
+
203
+ Just keep the code clean and the terminal fast.
204
+
205
+
129
206
  ## License
130
207
 
131
208
  MIT License — do whatever you want, just don’t blame me if you break stuff.
@@ -0,0 +1,25 @@
1
+ from .modules.user import get_user_rest as user
2
+ from .modules.repo import get_repo_rest as repo
3
+ from .modules.search import get_search_rest as search
4
+
5
+ from .utils.helpers import pretty_print as display
6
+
7
+ __version__ = "0.2.5"
8
+
9
+ USERS = "users"
10
+ REPOS = "repos"
11
+ PRS = "prs"
12
+ ISSUES = "issues"
13
+ TOPICS = "topics"
14
+
15
+ __all__ = [
16
+ "display",
17
+ "user",
18
+ "repo",
19
+ "search",
20
+ "USERS",
21
+ "REPOS",
22
+ "PRS",
23
+ "ISSUES",
24
+ "TOPICS",
25
+ ]
@@ -0,0 +1,61 @@
1
+ import argparse
2
+ from gitraze.handlers.user import handle_user
3
+ from gitraze.handlers.repo import handle_repo
4
+ from gitraze.handlers.search import handle_search
5
+ from gitraze.handlers.analyze import handle_analysis
6
+
7
+
8
+ def main():
9
+ parser = argparse.ArgumentParser(
10
+ prog="gitraze",
11
+ description="GitRaze CLI Tool"
12
+ )
13
+
14
+ # Global flag
15
+ parser.add_argument(
16
+ "--version",
17
+ action="version",
18
+ version="gitraze 0.2.5"
19
+ )
20
+
21
+ subparsers = parser.add_subparsers(dest="command", required=True)
22
+
23
+ # --- USER ---
24
+ user_parser = subparsers.add_parser("user", help="Fetch user info (GitHub username)")
25
+ user_parser.add_argument("username", help="Format: username")
26
+ user_parser.set_defaults(func=handle_user)
27
+
28
+
29
+ # --- REPO ---
30
+ repo_parser = subparsers.add_parser("repo", help="Fetch repo info (Repository in owner/repo format)")
31
+ repo_parser.add_argument("repo", help="Format: owner/repo")
32
+ repo_parser.set_defaults(func=handle_repo)
33
+
34
+
35
+ # --- SEARCH ---
36
+ search_parser = subparsers.add_parser("search", help="Search GitHub")
37
+ search_parser.add_argument("category",choices=["repos", "users", "issues", "prs", "topics"],help="repos | users | issues | prs | topics")
38
+ search_parser.add_argument("query", nargs="+", help="Search category (repos, users, issues, topics)")
39
+ search_parser.add_argument("-n", "--limit", type=int, default=1, help="Number of results to show")
40
+ search_parser.set_defaults(func=handle_search)
41
+
42
+
43
+ # --- ANALYZE ---
44
+ analyze_parser = subparsers.add_parser("analyze", help="Analyze target")
45
+ analyze_parser.add_argument("target", nargs="+")
46
+ analyze_parser.set_defaults(func=handle_analysis)
47
+
48
+ args = parser.parse_args()
49
+ args.func(args)
50
+
51
+
52
+
53
+
54
+ if __name__ == "__main__":
55
+ main()
56
+
57
+
58
+
59
+
60
+
61
+
@@ -7,16 +7,9 @@ REST_BASE_URL = "https://api.github.com"
7
7
  GRAPHQL_URL = "https://api.github.com/graphql"
8
8
  DEFAULT_TIMEOUT = 10
9
9
  DEFAULT_HEADERS = {
10
- "Accept": "application/vnd.github+json"
11
- }
12
-
13
- # --- USER CONFIG ---
14
-
15
-
16
- # --- REPO CONFIG ---
17
-
10
+ "Accept": "application/vnd.github+json"}
18
11
 
19
- # --- SEARCH CONFIG ---
12
+ # --- SEARCH CATEGORIES CONFIG ---
20
13
  SEARCH_MAP = {
21
14
  "repos": "repositories",
22
15
  "users": "users",
@@ -0,0 +1,7 @@
1
+ from gitraze.utils.helpers import pretty_print
2
+
3
+
4
+ def handle_analysis(args):
5
+ target = " ".join(args.target)
6
+ print(f"[ANALYZE] Analyzing '{target}'")
7
+ print("Not implemented yet")
@@ -0,0 +1,19 @@
1
+ from gitraze.utils.helpers import pretty_print
2
+ from gitraze.modules.repo import get_repo_rest
3
+
4
+ def handle_repo(args):
5
+ print("[+] Fetching repository data...")
6
+ parts = args.repo.split("/")
7
+
8
+ if len(parts) != 2:
9
+ print("Invalid format. Use: owner/repo")
10
+ return
11
+ owner, repo = parts
12
+ data = get_repo_rest(owner, repo)
13
+
14
+ if "error" in data:
15
+ print(data["error"])
16
+ return
17
+
18
+ print("[✓] Done")
19
+ pretty_print(data, title=f"User: {owner}, Repository: {repo}")
@@ -0,0 +1,26 @@
1
+ from gitraze.utils.helpers import pretty_print
2
+ from gitraze.modules.search import get_search_rest
3
+
4
+ def handle_search(args):
5
+ category = args.category
6
+
7
+ raw_query = " ".join(args.query)
8
+ clean_query = raw_query.replace('"', '')
9
+ query = f'"{clean_query}"'
10
+
11
+ print(f"[+] Searching {category} for {query}...")
12
+
13
+
14
+ data = get_search_rest(category, query, args.limit)
15
+
16
+ if "error" in data:
17
+ print(data["error"])
18
+ return
19
+
20
+ print("[✓] Done")
21
+
22
+ if isinstance(data, list):
23
+ for i, item in enumerate(data, 1):
24
+ pretty_print(item, title=f"{category} [{i}] -> {query}")
25
+ else:
26
+ pretty_print(data, title=f"Search: {category} -> {query}")
@@ -0,0 +1,13 @@
1
+ from gitraze.utils.helpers import pretty_print
2
+ from gitraze.modules.user import get_user_rest
3
+
4
+ def handle_user(args):
5
+ print("[+] Fetching user data...")
6
+ data = get_user_rest(args.username)
7
+
8
+ if "error" in data:
9
+ print(data["error"])
10
+ return
11
+
12
+ print("[✓] Done")
13
+ pretty_print(data, title=f"User: {args.username}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitraze
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: A CLI and Python library for GitHub reconnaissance, search, and analysis
5
5
  Author: AK Pandey
6
6
  License-Expression: MIT
@@ -65,7 +65,7 @@ pip install gitraze
65
65
 
66
66
  ## Usage
67
67
 
68
- Run directly from your terminal:
68
+ ### Run directly from your terminal:
69
69
 
70
70
  Example:
71
71
  ```bash
@@ -103,14 +103,79 @@ Email : None
103
103
  Twitter_username : None
104
104
 
105
105
  ```
106
- > 💡 Commands prefixed with `$` should be run in your terminal.
106
+ > Commands prefixed with `$` should be run in your terminal.
107
107
 
108
- You can also use it inside Python:
108
+ ### Gitraze can also be used as a lightweight Python SDK.
109
109
 
110
+ #### User:
110
111
  ```python
111
- import gitraze
112
+ import gitraze as gz
113
+
114
+ user = gz.user("octocat")
115
+
116
+ print(user["name"])
117
+ print(user["followers"])
118
+ ```
119
+
120
+ #### Search:
121
+
122
+ ```python
123
+ results = gz.search(gz.REPOS, "machine learning", 3)
124
+
125
+ for repo in results:
126
+ print(repo["full_name"])
127
+ ```
128
+
129
+ ### Pretty-print results in terminal style:
130
+
131
+ ```python
132
+ from gitraze import *
133
+
134
+ display(user("octocat"))
112
135
  ```
113
136
 
137
+ Example output:
138
+
139
+ ```bash
140
+ Name : The Octocat
141
+ Login : octocat
142
+ Id : 583231
143
+ Node_id : MDQ6VXNlcjU4MzIzMQ==
144
+ Type : User
145
+ User_view_type : public
146
+ Bio : None
147
+ Followers : 22578
148
+ Following : 9
149
+ Public_repos : 8
150
+ Public_gists : 8
151
+ Location : San Francisco
152
+ Profile_url : https://github.com/octocat
153
+ Created_at : 25 Jan 2011
154
+ Email : None
155
+ Twitter_username : None
156
+ ```
157
+
158
+ > Note: **`import gitraze as gz`** is the recommended import.
159
+
160
+ ## Available exports:
161
+
162
+ ### Functions:
163
+
164
+ - `user()`
165
+ - `repo()`
166
+ - `search()`
167
+ - `display()`
168
+
169
+ ### Constants:
170
+
171
+ - `USERS`
172
+ - `REPOS`
173
+ - `PRS`
174
+ - `ISSUES`
175
+ - `TOPICS`
176
+
177
+
178
+
114
179
  ⚠️ CLI commands are still evolving and may change.
115
180
 
116
181
  ## Philosophy
@@ -143,6 +208,18 @@ Gitraze is in active development:
143
208
 
144
209
  If you're here early — you're basically a beta tester 😈
145
210
 
211
+ ## Contributing
212
+
213
+ PRs, ideas, bug reports, and feature suggestions are welcome.
214
+ If you want to improve or modify Gitraze, go ahead.
215
+
216
+ ```bash
217
+ git checkout -b feature/cool-thing
218
+ ```
219
+
220
+ Just keep the code clean and the terminal fast.
221
+
222
+
146
223
  ## License
147
224
 
148
225
  MIT License — do whatever you want, just don’t blame me if you break stuff.
@@ -13,6 +13,11 @@ gitraze.egg-info/top_level.txt
13
13
  gitraze/core/__init__.py
14
14
  gitraze/core/api_graphql.py
15
15
  gitraze/core/api_rest.py
16
+ gitraze/handlers/__init__.py
17
+ gitraze/handlers/analyze.py
18
+ gitraze/handlers/repo.py
19
+ gitraze/handlers/search.py
20
+ gitraze/handlers/user.py
16
21
  gitraze/modules/__init__.py
17
22
  gitraze/modules/analytics.py
18
23
  gitraze/modules/repo.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gitraze"
3
- version = "0.2.3"
3
+ version = "0.2.5"
4
4
  description = "A CLI and Python library for GitHub reconnaissance, search, and analysis"
5
5
  authors = [{ name = "AK Pandey" }]
6
6
  dependencies = ["requests", "colorama"]
@@ -1,116 +0,0 @@
1
- import argparse
2
- from gitraze.utils.helpers import pretty_print
3
- from gitraze.modules.user import get_user_rest
4
- from gitraze.modules.repo import get_repo_rest
5
- from gitraze.modules.search import get_search_rest
6
-
7
-
8
- def main():
9
- parser = argparse.ArgumentParser(
10
- prog="gitraze",
11
- description="GitRaze CLI Tool"
12
- )
13
-
14
- # Global flag
15
- parser.add_argument(
16
- "--version",
17
- action="version",
18
- version="gitraze 0.2.3"
19
- )
20
-
21
- subparsers = parser.add_subparsers(dest="command", required=True)
22
-
23
- # --- USER ---
24
- user_parser = subparsers.add_parser("user", help="Fetch user info (GitHub username)")
25
- user_parser.add_argument("username", help="Format: username")
26
-
27
- # --- REPO ---
28
- repo_parser = subparsers.add_parser("repo", help="Fetch repo info (Repository in owner/repo format)")
29
- repo_parser.add_argument("repo", help="Format: owner/repo")
30
-
31
- # --- SEARCH ---
32
- search_parser = subparsers.add_parser("search", help="Search GitHub")
33
- search_parser.add_argument("category",choices=["repos", "users", "issues", "prs", "topics"],help="repos | users | issues | prs | topics")
34
- search_parser.add_argument("query", nargs="+", help="Search category (repos, users, issues, topics)")
35
- search_parser.add_argument("-n", "--limit", type=int, default=1, help="Number of results to show")
36
-
37
- # --- ANALYZE ---
38
- analyze_parser = subparsers.add_parser("analyze", help="Analyze target")
39
- analyze_parser.add_argument("target", nargs="+")
40
-
41
- args = parser.parse_args()
42
-
43
- # --- ROUTING ---
44
- if args.command == "user":
45
- handle_user(args)
46
- elif args.command == "repo":
47
- handle_repo(args)
48
- elif args.command == "search":
49
- handle_search(args)
50
- elif args.command == "analyze":
51
- handle_analysis(args)
52
- else:
53
- parser.print_help()
54
-
55
-
56
- # --- HANDLERS ---
57
-
58
- def handle_user(args):
59
- print("[+] Fetching user data...")
60
- data = get_user_rest(args.username)
61
-
62
- if "error" in data:
63
- print(data["error"])
64
- return
65
-
66
- print("[✓] Done")
67
- pretty_print(data, title=f"User: {args.username}")
68
-
69
-
70
- def handle_repo(args):
71
- print("[+] Fetching repository data...")
72
- parts = args.repo.split("/")
73
-
74
- if len(parts) != 2:
75
- print("Invalid format. Use: owner/repo")
76
- return
77
- owner, repo = parts
78
- data = get_repo_rest(owner, repo)
79
-
80
- if "error" in data:
81
- print(data["error"])
82
- return
83
-
84
- print("[✓] Done")
85
- pretty_print(data, title=f"User: {owner}, Repository: {repo}")
86
-
87
-
88
- def handle_search(args):
89
- category = args.category
90
-
91
- raw_query = " ".join(args.query)
92
- clean_query = raw_query.replace('"', '')
93
- query = f'"{clean_query}"'
94
-
95
- print(f"[+] Searching {category} for {query}...")
96
-
97
-
98
- data = get_search_rest(category, query, args.limit)
99
-
100
- if "error" in data:
101
- print(data["error"])
102
- return
103
-
104
- print("[✓] Done")
105
-
106
- if isinstance(data, list):
107
- for i, item in enumerate(data, 1):
108
- pretty_print(item, title=f"{category} [{i}] -> {query}")
109
- else:
110
- pretty_print(data, title=f"Search: {category} -> {query}")
111
-
112
-
113
- def handle_analysis(args):
114
- target = " ".join(args.target)
115
- print(f"[ANALYZE] Analyzing '{target}'")
116
- print("Not implemented yet")
File without changes
File without changes
File without changes
File without changes