gitraze 0.0.2__tar.gz → 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.
Files changed (25) hide show
  1. gitraze-0.1.0/LICENSE +21 -0
  2. {gitraze-0.0.2 → gitraze-0.1.0}/PKG-INFO +3 -1
  3. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/cli.py +21 -7
  4. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/core/api_rest.py +12 -7
  5. gitraze-0.1.0/gitraze/modules/repo.py +32 -0
  6. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/modules/user.py +1 -1
  7. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze.egg-info/PKG-INFO +3 -1
  8. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze.egg-info/SOURCES.txt +1 -0
  9. {gitraze-0.0.2 → gitraze-0.1.0}/pyproject.toml +1 -1
  10. gitraze-0.0.2/gitraze/modules/repo.py +0 -1
  11. {gitraze-0.0.2 → gitraze-0.1.0}/README.md +0 -0
  12. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/__init__.py +0 -0
  13. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/config.py +0 -0
  14. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/core/__init__.py +0 -0
  15. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/core/api_graphql.py +0 -0
  16. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/modules/__init__.py +0 -0
  17. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/modules/analytics.py +0 -0
  18. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/modules/search.py +0 -0
  19. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/utils/__init__.py +0 -0
  20. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze/utils/helpers.py +0 -0
  21. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze.egg-info/dependency_links.txt +0 -0
  22. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze.egg-info/entry_points.txt +0 -0
  23. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze.egg-info/requires.txt +0 -0
  24. {gitraze-0.0.2 → gitraze-0.1.0}/gitraze.egg-info/top_level.txt +0 -0
  25. {gitraze-0.0.2 → gitraze-0.1.0}/setup.cfg +0 -0
gitraze-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AK Pandey (akpandey-dev)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitraze
3
- Version: 0.0.2
3
+ Version: 0.1.0
4
4
  Summary: A CLI and Python library for GitHub reconnaissance, search, and analysis
5
5
  Author: AK Pandey
6
6
  License: MIT
@@ -10,8 +10,10 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.8
12
12
  Description-Content-Type: text/markdown
13
+ License-File: LICENSE
13
14
  Requires-Dist: requests
14
15
  Requires-Dist: colorama
16
+ Dynamic: license-file
15
17
 
16
18
  # Gitraze
17
19
 
@@ -1,6 +1,7 @@
1
1
  import argparse
2
2
  from gitraze.utils.helpers import pretty_print
3
- from gitraze.modules.user import get_user
3
+ from gitraze.modules.user import get_user_rest
4
+ from gitraze.modules.repo import get_repo_rest
4
5
 
5
6
 
6
7
  def main():
@@ -13,18 +14,18 @@ def main():
13
14
  parser.add_argument(
14
15
  "--version",
15
16
  action="version",
16
- version="gitraze 0.0.2"
17
+ version="gitraze 0.1.0"
17
18
  )
18
19
 
19
20
  subparsers = parser.add_subparsers(dest="command", required=True)
20
21
 
21
22
  # --- USER ---
22
23
  user_parser = subparsers.add_parser("user", help="Fetch user info (GitHub username)")
23
- user_parser.add_argument("username")
24
+ user_parser.add_argument("username", help="Format: username")
24
25
 
25
26
  # --- REPO ---
26
27
  repo_parser = subparsers.add_parser("repo", help="Fetch repo info (Repository in owner/repo format)")
27
- repo_parser.add_argument("repo")
28
+ repo_parser.add_argument("repo", help="Format: owner/repo")
28
29
 
29
30
  # --- SEARCH ---
30
31
  search_parser = subparsers.add_parser("search", help="Search GitHub")
@@ -53,7 +54,7 @@ def main():
53
54
 
54
55
  def handle_user(args):
55
56
  print("[+] Fetching user data...")
56
- data = get_user(args.username)
57
+ data = get_user_rest(args.username)
57
58
 
58
59
  if "error" in data:
59
60
  print(data["error"])
@@ -64,8 +65,21 @@ def handle_user(args):
64
65
 
65
66
 
66
67
  def handle_repo(args):
67
- print(f"[REPO] Fetching data for {args.repo}")
68
- print("Not implemented yet")
68
+ print("[+] Fetching repository data...")
69
+ parts = args.repo.split("/")
70
+
71
+ if len(parts) != 2:
72
+ print("Invalid format. Use: owner/repo")
73
+ return
74
+ owner, repo = parts
75
+ data = get_repo_rest(owner, repo)
76
+
77
+ if "error" in data:
78
+ print(data["error"])
79
+ return
80
+
81
+ print("[✓] Done")
82
+ pretty_print(data, title=f"User: {owner}, Repository: {repo}")
69
83
 
70
84
 
71
85
  def handle_search(args):
@@ -2,9 +2,6 @@
2
2
  import requests
3
3
  from gitraze.config import REST_BASE_URL, DEFAULT_HEADERS, DEFAULT_TIMEOUT
4
4
 
5
-
6
- import requests
7
-
8
5
  def get_user(username):
9
6
  url = f"{REST_BASE_URL}/users/{username}"
10
7
 
@@ -26,9 +23,17 @@ def get_user(username):
26
23
 
27
24
  def get_repo(owner, repo):
28
25
  url = f"{REST_BASE_URL}/repos/{owner}/{repo}"
29
- response = requests.get(url, headers=DEFAULT_HEADERS, timeout=DEFAULT_TIMEOUT)
26
+ try:
27
+ response = requests.get(
28
+ url,
29
+ headers=DEFAULT_HEADERS,
30
+ timeout=DEFAULT_TIMEOUT
31
+ )
32
+ response.raise_for_status()
33
+ return response.json()
30
34
 
31
- if response.status_code != 200:
32
- return {"error": f"Failed to fetch repo: {response.status_code}"}
35
+ except requests.exceptions.Timeout:
36
+ return {"error": "Request timed out. Check your connection."}
33
37
 
34
- return response.json()
38
+ except requests.exceptions.RequestException as e:
39
+ return {"error": f"Request failed: {str(e)}"}
@@ -0,0 +1,32 @@
1
+ # repo.py
2
+ from gitraze.utils.helpers import format_date
3
+ from gitraze.core.api_rest import get_repo as rest_get_repo
4
+
5
+ def get_repo_rest(owner, repo):
6
+ data = rest_get_repo(owner, repo)
7
+
8
+ if "error" in data:
9
+ return data
10
+
11
+ return {
12
+ "name": data.get("name"),
13
+ "full_name": data.get("full_name"),
14
+ "owner": data.get("owner", {}).get("login"),
15
+ "description": data.get("description"),
16
+ "private": data.get("private"),
17
+ "fork": data.get("fork"),
18
+ "language": data.get("language"),
19
+ "topics": data.get("topics"),
20
+ "stars": data.get("stargazers_count"),
21
+ "forks": data.get("forks_count"),
22
+ "watchers": data.get("watchers_count"),
23
+ "open_issues": data.get("open_issues_count"),
24
+ "size": data.get("size"),
25
+ "default_branch": data.get("default_branch"),
26
+ "repo_url": data.get("html_url"),
27
+ "clone_url": data.get("clone_url"),
28
+ "created_at": format_date(data.get("created_at")),
29
+ "updated_at": format_date(data.get("updated_at")),
30
+ "pushed_at": format_date(data.get("pushed_at")),
31
+ "license": data.get("license", {}).get("name") if data.get("license") else None,
32
+ }
@@ -2,7 +2,7 @@
2
2
  from gitraze.utils.helpers import format_date
3
3
  from gitraze.core.api_rest import get_user as rest_get_user
4
4
 
5
- def get_user(username):
5
+ def get_user_rest(username):
6
6
  data = rest_get_user(username)
7
7
 
8
8
  if "error" in data:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitraze
3
- Version: 0.0.2
3
+ Version: 0.1.0
4
4
  Summary: A CLI and Python library for GitHub reconnaissance, search, and analysis
5
5
  Author: AK Pandey
6
6
  License: MIT
@@ -10,8 +10,10 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.8
12
12
  Description-Content-Type: text/markdown
13
+ License-File: LICENSE
13
14
  Requires-Dist: requests
14
15
  Requires-Dist: colorama
16
+ Dynamic: license-file
15
17
 
16
18
  # Gitraze
17
19
 
@@ -1,3 +1,4 @@
1
+ LICENSE
1
2
  README.md
2
3
  pyproject.toml
3
4
  gitraze/__init__.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gitraze"
3
- version = "0.0.2"
3
+ version = "0.1.0"
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 +0,0 @@
1
- # repo.py
File without changes
File without changes
File without changes
File without changes