Skip to content

Commit 54fa03d

Browse files
committed
Versioning, added banner & infobox
1 parent 3963bad commit 54fa03d

File tree

7 files changed

+72
-2
lines changed

7 files changed

+72
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![1000136215](https://github.com/user-attachments/assets/49ec8d24-665b-4115-8525-01a8d0ca2ef4)
44
<p align="center">
5-
<img src="https://img.shields.io/badge/Version-1.0.1.6-blueviolet?style=for-the-badge&logo=github" />
5+
<img src="https://img.shields.io/badge/Version-1.0.2.0-blueviolet?style=for-the-badge&logo=github" />
66
<img src="https://img.shields.io/github/issues/kaifcodec/user-scanner?style=for-the-badge&logo=github" />
77
<img src="https://img.shields.io/badge/Tested%20on-Termux-black?style=for-the-badge&logo=termux" />
88
<img src="https://img.shields.io/badge/Tested%20on-Windows-cyan?style=for-the-badge&logo=Windows" />

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
44

55
[project]
66
name = "user-scanner"
7-
version = "1.0.1.6"
7+
version = "1.0.2.0"
88
description = "Check username availability across multiple popular platforms"
99
readme = "README.md"
1010
license = {file = "LICENSE"}

user_scanner/__main__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import re
33
from user_scanner.core.orchestrator import run_checks, load_modules
44
from colorama import Fore, Style
5+
from .cli import banner
6+
from .cli.banner import print_banner
7+
58

69
CATEGORY_MAPPING = {
710
"dev": "dev",
@@ -67,6 +70,10 @@ def main():
6770
if (args.module == "bluesky" or args.category == "social"):
6871
if re.search(r"[^a-zA-Z0-9\.-]", args.username):
6972
print(Fore.RED + f"[!] Username '{args.username}' contains unsupported special characters. Bluesky will throw error. (Supported: only hyphens and digits)" + Style.RESET_ALL +"\n")
73+
if not args.username:
74+
pass
75+
else:
76+
print_banner()
7077

7178

7279
from user_scanner import dev, social, creator, community, gaming

user_scanner/cli/__init__.py

Whitespace-only changes.

user_scanner/cli/banner.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import json
2+
from colorama import Fore, Style, init
3+
from ..utils.version import load_local_version
4+
5+
6+
version, version_type = load_local_version()
7+
init(autoreset=True)
8+
C_RED = Fore.RED + Style.BRIGHT
9+
C_CYAN = Fore.CYAN + Style.BRIGHT
10+
C_GREEN = Fore.GREEN + Style.BRIGHT
11+
C_WHITE = Fore.WHITE + Style.BRIGHT
12+
C_MAGENTA = Fore.MAGENTA + Style.BRIGHT
13+
BANNER_ASCII = fr"""{C_CYAN} _ _ ___ ___ _ __ ___ ___ __ _ _ __ _ __ ___ _ __
14+
| | | / __|/ _ \ '__|____/ __|/ __/ _` | '_ \| '_ \ / _ \ '__|
15+
| |_| \__ \ __/ | |_____\__ \ (_| (_| | | | | | | | __/ |
16+
\__,_|___/\___|_| |___/\___\__,_|_| |_|_| |_|\___|_| Version: {version}
17+
{Style.RESET_ALL}""".strip()
18+
19+
INFO_BOX = f"""{C_MAGENTA} ╔════════════════════════════════════════╗
20+
{C_RED}{C_GREEN}Project Name{C_WHITE} : UserScanner {C_MAGENTA}
21+
{C_RED}{C_GREEN}Author{C_WHITE} : Kaif {C_MAGENTA}
22+
{C_RED}{C_GREEN}Github{C_WHITE} : github.com/kaifcodec {C_MAGENTA}
23+
{C_RED}{C_GREEN}Email{C_WHITE} : [email protected] {C_MAGENTA}
24+
══════════════════════════════════════════{Style.RESET_ALL}""".strip()
25+
26+
def print_banner():
27+
print(BANNER_ASCII)
28+
print(INFO_BOX)
29+
print(" ")
30+
if __name__ == "__main__":
31+
print_banner()
32+
33+
34+
35+
36+
37+
38+
39+

user_scanner/utils/version.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import json
2+
from pathlib import Path
3+
4+
_SCRIPT_DIR = Path(__file__).resolve().parent
5+
VERSION_FILE = _SCRIPT_DIR.parent / "version.json"
6+
7+
def load_local_version():
8+
try:
9+
data = json.loads(VERSION_FILE.read_text())
10+
return data.get("version", "0.0.0"), data.get("version_type", "local")
11+
except FileNotFoundError:
12+
return "N/A", "file_missing"
13+
except json.JSONDecodeError:
14+
return "N/A", "json_error"
15+
except Exception:
16+
return "N/A", "error"
17+
18+
if __name__ == "__main__":
19+
version, version_type = load_local_version()
20+
print(f"Version: {version}, Type: {version_type}")

user_scanner/version.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"version": "1.0.2.0",
3+
"version_type": "pypi"
4+
}

0 commit comments

Comments
 (0)