gitseek 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.
- gitseek-0.1.0/LICENSE +0 -0
- gitseek-0.1.0/PKG-INFO +8 -0
- gitseek-0.1.0/README.md +13 -0
- gitseek-0.1.0/gitseek/__init__.py +0 -0
- gitseek-0.1.0/gitseek/cli.py +39 -0
- gitseek-0.1.0/gitseek/github_api.py +21 -0
- gitseek-0.1.0/gitseek.egg-info/PKG-INFO +8 -0
- gitseek-0.1.0/gitseek.egg-info/SOURCES.txt +12 -0
- gitseek-0.1.0/gitseek.egg-info/dependency_links.txt +1 -0
- gitseek-0.1.0/gitseek.egg-info/entry_points.txt +2 -0
- gitseek-0.1.0/gitseek.egg-info/requires.txt +1 -0
- gitseek-0.1.0/gitseek.egg-info/top_level.txt +1 -0
- gitseek-0.1.0/pyproject.toml +17 -0
- gitseek-0.1.0/setup.cfg +4 -0
gitseek-0.1.0/LICENSE
ADDED
|
File without changes
|
gitseek-0.1.0/PKG-INFO
ADDED
gitseek-0.1.0/README.md
ADDED
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import webbrowser
|
|
3
|
+
import subprocess
|
|
4
|
+
|
|
5
|
+
from .github_api import search_repositories
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def main():
|
|
9
|
+
parser = argparse.ArgumentParser(description="Search GitHub projects")
|
|
10
|
+
|
|
11
|
+
parser.add_argument("query", nargs="+")
|
|
12
|
+
parser.add_argument("--stars", type=int)
|
|
13
|
+
parser.add_argument("--limit", type=int, default=5)
|
|
14
|
+
parser.add_argument("--open", type=int)
|
|
15
|
+
parser.add_argument("--clone", type=int)
|
|
16
|
+
|
|
17
|
+
args = parser.parse_args()
|
|
18
|
+
|
|
19
|
+
query = " ".join(args.query)
|
|
20
|
+
|
|
21
|
+
repos = search_repositories(query, args.stars, args.limit)
|
|
22
|
+
|
|
23
|
+
if not repos:
|
|
24
|
+
print("No repositories found.")
|
|
25
|
+
return
|
|
26
|
+
|
|
27
|
+
for i, repo in enumerate(repos, start=1):
|
|
28
|
+
print(f"\n[{i}] {repo['name']}")
|
|
29
|
+
print(f"⭐ {repo['stargazers_count']}")
|
|
30
|
+
print(repo["description"])
|
|
31
|
+
print(repo["html_url"])
|
|
32
|
+
|
|
33
|
+
if args.open:
|
|
34
|
+
repo = repos[args.open - 1]
|
|
35
|
+
webbrowser.open(repo["html_url"])
|
|
36
|
+
|
|
37
|
+
if args.clone:
|
|
38
|
+
repo = repos[args.clone - 1]
|
|
39
|
+
subprocess.run(["git", "clone", repo["html_url"]])
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
|
|
3
|
+
GITHUB_API = "https://api.github.com/search/repositories"
|
|
4
|
+
|
|
5
|
+
def search_repositories(query, stars=None, limit=5):
|
|
6
|
+
q = query
|
|
7
|
+
|
|
8
|
+
if stars:
|
|
9
|
+
q += f" stars:>{stars}"
|
|
10
|
+
|
|
11
|
+
params = {
|
|
12
|
+
"q": q,
|
|
13
|
+
"sort": "stars",
|
|
14
|
+
"order": "desc",
|
|
15
|
+
"per_page": limit
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
response = requests.get(GITHUB_API, params=params)
|
|
19
|
+
data = response.json()
|
|
20
|
+
|
|
21
|
+
return data.get("items", [])
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
gitseek/__init__.py
|
|
5
|
+
gitseek/cli.py
|
|
6
|
+
gitseek/github_api.py
|
|
7
|
+
gitseek.egg-info/PKG-INFO
|
|
8
|
+
gitseek.egg-info/SOURCES.txt
|
|
9
|
+
gitseek.egg-info/dependency_links.txt
|
|
10
|
+
gitseek.egg-info/entry_points.txt
|
|
11
|
+
gitseek.egg-info/requires.txt
|
|
12
|
+
gitseek.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gitseek
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "gitseek"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Search GitHub projects from the terminal"
|
|
9
|
+
authors = [
|
|
10
|
+
{name="Ashish Des"}
|
|
11
|
+
]
|
|
12
|
+
dependencies = [
|
|
13
|
+
"requests"
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[project.scripts]
|
|
17
|
+
gitseek = "gitseek.cli:main"
|
gitseek-0.1.0/setup.cfg
ADDED