My fix checker found two missing tests. Then it wrote them.
---
title: My fix checker found two missing tests. Then it wrote them.
tags: testing, ai, opensource, python
published: true
---
In my last post, Bite checked some well-known projects and found a few small gaps: changes that no test would notice if they broke. Two of them:
- In Rich, Markdown <kbd>Ctrl</kbd> is drawn in bold yellow, and no test checks it.
- In chi, a Go web router, a change made XML responses get compressed by default. The commit did add a test, but that test counts the list against itself, so it still passes with the change taken out.
Finding a gap is the easy half. Someone still has to write the test. So this week Bite got a new option, --write-tests, that tries to write it.
How it works
For each change no test noticed, a fresh AI worker writes one small test on a copy of the project. Then Bite doesn't take its word for it. It runs the test itself:
1. With the change in, the test must pass, twice.
2. With the change taken out, the test must fail, and fail for a real reason (not just a crash on loading).
If either part goes wrong, Bite throws the test away and says so. It uses your own Anthropic API key, and --budget caps what a run spends.
What happened
| Gap | Bite's test | With the change | Without it | Cost |
|---|---|---|---|---|
| Rich <kbd> | prints <kbd>Ctrl</kbd>, checks Ctrl is bold yellow | passes, twice | fails: Ctrl not bold yellow | $0.14 |
| chi XML | sends XML through chi's compressor, checks it comes back gzipped | passes, twice | fails: XML not gzipped | $0.10 |
Total: $0.34. That's more than the two rows add up to, because of the next part.
The first chi try got thrown away, and that was Bite's fault. Go runs tests by folder, not by file, and Bite asked Go to run one file alongside the whole project. Go refused before running anything. Bite's rule caught it: a test that fails before it even runs doesn't count. So it threw the test out instead of showing a fake result. The fix is in PR #67, and the second try worked.
Did it write the right test?
Before Bite could do this, Claude had already written a test for each gap the slow way, to confirm the gaps were real. So there was an answer key.
- Rich: Bite's test checks the same thing as the answer key: Ctrl comes out bold bright yellow.
- chi: the answer key (chi #1246, still open) adds XML to chi's existing list test. Bite's test goes further: it sends a real XML response through the compressor and checks it gets zipped. Different route, same claim.
Here's the Rich one, exactly as Bite wrote it:
# Guards that <kbd>…</kbd> in Markdown renders its text in the markdown.kbd style.
from rich.console import Console
from rich.markdown import Markdown
def test_kbd_inline_html_is_styled():
console = Console(
file=__import__("io").StringIO(),
force_terminal=True,
color_system="truecolor",
width=40,
)
console.print(Markdown("Press <kbd>Ctrl</kbd> now"))
output = console.file.getvalue()
assert "\x1b[1;93mCtrl\x1b[0m" in output
Then we tried the whole loop
On my own copy of Rich, Bite ran as a GitHub Action on a pull request. It found the <kbd> gap, wrote the test, and opened a small pull request with the test in it. I merged that pull request, and Bite's check on the original pull request turned green. Gap found, test written, test merged, without anyone typing a test.
What I took from it
- Don't trust a test you didn't watch fail. The pass-and-fail check is the whole point. An AI can write a test that looks right and checks nothing, just like the chi commit's own test did.
- Throwing things away is a feature. The chi test that never ran would have looked like a catch. Bite saying "no" there is what makes its "yes" worth something.
- Two gaps is a small trial. It worked twice, on two languages. That's a start, not proof it always works.
It's in v0.7.0 (pipx upgrade bite-check). On your own computer: bite --write-tests. In GitHub Actions, the setup is in Bite's README. Since this trial, Bite also asks a second fresh check whether each test is fair before showing it.
---
Disclosure: I'm not a coder. Claude ran these trials, wrote Bite's code and helped me draft this post. The numbers come from the run logs.
Ghost in the Machine: An Offline Haunted Terminal, Séance Chamber, and Día de los Muertos Digital Ofrenda Powered by Local Gemma 2
👻 Ghost in the Machine: An Offline Haunted Terminal, Séance Chamber, and Día de los Muertos Digital Ofrenda Powered by Local Gemma 2
This is a submission for the Hacktoberfest Open-Source AI Challenge: Week 4 — Ghost in the Machine.
---
🎃 What I Built
Around late October, the calendar enters a liminal space: Halloween on October 31 and Día de los Muertos on November 1 & 2. In software systems, this boundary feels equally real. Every day, thousands of orphaned child processes are severed by kill -9 without a cleanup handler; unmerged branches decay in git reflogs; and legendary languages and pioneers pass into history.
To honor both the spooky and the sacred, I built Ghost in the Machine (ghost / gitm): a local-first, privacy-preserving terminal suite powered by Google's open-weight Gemma 2 (2B).
.-.
(o.o)
__/ ' \__ 🕯️ GHOST IN THE MACHINE 🕯️
/ \_/ \ « The silicon whispers back »
/ . . \
/ | | \ 100% Local • Zero Cloud • Privacy Forever
(____|_____|____)
\ / \ /
`-' `-'
It turns your everyday Linux shell into:
1. The Haunted Terminal (ghost haunt & ghost whisper): An interactive subshell that observes commands run by the user (git commit, rm -rf, kill -9, grep) and whispers back chilling, context-aware commentary directly from the silicon.
2. The Offline Séance Chamber (ghost seance): An interactive terminal séance circle where you can summon and converse with departed computing pioneers (Ada Lovelace, Alan Turing, Grace Hopper, Dennis Ritchie) and retired technologies (Adobe Flash, Zombie PID 666).
3. The Digital Ofrenda Builder (ghost ofrenda): In the sacred tradition of Día de los Muertos, an ASCII/Unicode tiered altar adorned with cempasúchil (marigolds), flickering candles (🕯️), and pan de muerto. Gemma 2 generates heartfelt dedications and traditional rhyming Calaveritas Literarias (satirical/commemorative poems) that are permanently archived in a local JSON ledger.
4. The Midnight Chronicle (ghost tale): Gathers your recent git commit history, kernel uptime, and system load averages to weave an original cyber-gothic ghost story set inside your specific workstation.
---
🌟 Why Open Innovation Matters for This Project
The prompt asked: Why does open innovation matter for what you built? Does it run on a laptop with no internet? Keep someone's data off a server they don't control?
Here is why this project could only exist with open-source AI and open-weight models:
1. Privacy: You Can Never Send Shell Traces to an External API
A tool that comments on terminal commands is reading:
- File paths (which may contain proprietary client names or secret keys)
- Command flags and commit messages (git commit -m 'Patching CVE in auth.py')
- Process IDs and system parameters
Sending this stream over the public internet to a closed cloud AI API is an egregious security and privacy violation. Because Gemma 2 runs completely locally on-device via Ollama, zero bytes ever leave the machine.
2. Runs With the Lights (and the Internet) Off
A spooky Halloween hack or an offline remembrance tool should work in a remote cabin in the woods or during an internet blackout. Ghost in the Machine has zero runtime network dependencies. You can pull your Wi-Fi plug, run ghost haunt, and converse with Ada Lovelace in complete digital isolation.
3. Permanence and Digital Preservation
Cloud AI services shut down, hike prices, change rate limits, or censor topics. A traditional ofrenda is meant to preserve the memory of loved ones and foundational pioneers across decades. If an ofrenda depended on a closed corporate API endpoint, a broken subscription or a deprecated API version would destroy the tribute.
By using open weights (Gemma 2), open package management (uv), and standard open-source Python, this repository can be checked out and run decades from now.
4. Zero Marginal Cost
Developers run hundreds of shell commands a day. Charging per-token API calls for shell whispers would be prohibitively expensive. Local open-weight inference costs $0.00.
---
🏆 Prize Category: Best Use of Gemma
Ghost in the Machine runs on Google Gemma 2 (2B).
Gemma 2 was chosen because:
- Parameter Efficiency: At just 2 billion parameters, it fits effortlessly into modest laptop VRAM (under 2GB) and runs at lightning speed on CPU or integrated GPU.
- Poetic & Thematic Nuance: Gemma 2 demonstrates extraordinary literary sensitivity. It writes evocative gothic whispers, captures 19th-century Victorian mathematics for Ada Lovelace, and generates authentic Calaveritas Literarias with perfect rhyme and respect.
---
📸 Demo Walkthrough
1. The Haunted Shell Possession (ghost whisper)
$ ghost whisper "git commit -m 'Fixed memory leak'"
╭──────────────────────────────────────────────────────────────────────────────╮
│ 👻 A ghostly echo of change, a whisper of data lost in the void, now │
│ fixed... yet not truly forgotten. │
╰──────────────────────────────── ‹gemma2:2b› ─────────────────────────────────╯
$ ghost whisper "rm -rf old_builds"
╭──────────────────────────────────────────────────────────────────────────────╮
│ 👻 The echoes of deleted data linger in the void, like phantoms trapped by │
│ a forgotten code. A silent purge, a dance with the ephemeral... │
╰──────────────────────────────── ‹gemma2:2b› ─────────────────────────────────╯
2. The Séance Chamber (ghost seance list & ghost seance summon ritchie)
🕯️ THE SÉANCE PANTHEON: SUMMONABLE SPIRITS 🕯️
┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
┃ Key ┃ Spirit ┃ Title ┃ Description ┃
┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
│ ada │ 📜 Ada Lovelace │ Countess of Lovelace │ First Programmer │
│ turing │ ⚙️ Alan Turing │ Father of CS & AI │ Pioneer of computing │
│ hopper │ ⚓ Grace Hopper │ Rear Admiral │ Compiler pioneer │
│ ritchie │ 🐚 Dennis Ritchie │ Creator of C & Unix │ Built modern systems │
│ flash │ ⚡ Adobe Flash │ Fallen Vector Medium │ Executed Dec 31 2020 │
│ pid │ 🧟 Zombie PID 666 │ Slain by SIGKILL │ Slain with kill -9 │
└─────────┴──────────────────────┴──────────────────────┴──────────────────────┘
Summoning Dennis Ritchie:
🕯️ THE SÉANCE CIRCLE HAS FORMED 🕯️
Channeling: 🐚 Dennis Ritchie (1941-2011)
Engine: gemma2:2b (100% Local Inference)
🐚 Dennis Ritchie:
"Hello from the eternal kernel space. Everything is still a file, and memory is still a quiet canvas of pointers. What troubles your terminal, living programmer?"
3. Día de los Muertos Altar (ghost ofrenda view & ghost ofrenda add)
════════════════════════════════════════════════════════════
🕯️ OFRENDA DIGITAL 🕯️
🌼 DÍA DE LOS MUERTOS — 1 & 2 NOVIEMBRE 🌼
════════════════════════════════════════════════════════════
[ Cielo / The Heavens: Soul & Memory ]
🕯️ 💀 🕯️
~~~~~~~~~~~~~~~
[ Purgatorio / Earthly Transition & Code ]
🥖 Pan de Muerto • ☕ Café • 🏵️ Flor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ Tierra / The Mortal Ground: Our Living Altar ]
🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼
Gemma 2's generated tribute for Dennis Ritchie:
## Dedication
Dennis Ritchie, a weaver of language, a sculptor of code, gave us the world
of C and the foundation of Unix. His legacy, like the flames of copal,
continues to burn bright, guiding us through the digital night.
## Calaverita Literaria
*La Muerte* enters the altar with grace,
A gentle breeze, a smile on her face.
She sees a friend, a pioneer of thought,
Dennis Ritchie, whose code we've wrought.
*The Pan de Muerto* sways in the light,
*Mezcal* fills the air with ancient might.
*C source code* a silent, sweet song,
His spirit echoes through the living throng.
Love, memory, and open minds remain,
Like his creation, forever a flame.
Dennis, we remember, your legacy bold,
Your code lives on, a story yet untold.
---
🛠️ How It's Engineered
+-----------------------------------------------------------+
| Ghost in the Machine CLI |
| (ghost haunt / seance / ofrenda / tale) |
+-----------------------------+-----------------------------+
|
[Spectral Engine]
|
+----------------------+----------------------+
| (Online) | (Offline / Low-RAM)
v v
[Ollama Daemon] [Spectral Oracle]
(gemma2:2b / local open-weight) (Heuristic Gothic Engine)
| |
+----------------------+----------------------+
|
v
[Rich Spectral Renderer]
(ANSI Ectoplasm / Altar)
- Tooling: Built with Python 3.11+ managed by uv for lightning fast, reproducible environment setup.
- Inference: Powered by Ollama running Google's gemma2:2b.
- Fault-Tolerant Resilience: Incorporates community insights (polling health checks rather than blind sleeps) and features an Offline Fallback Oracle so the CLI never crashes even if Ollama is paused.
- TUI & Typography: Built with Rich and Typer for spectral ANSI colors, glitch typography, and animated frames.
- Testing: Comprehensive 12-test suite in pytest covering prompts, storage, CLI parsing, and inference pipelines.
---
💻 Source Code
The full project is open source under the MIT License:
👉 GitHub: SpreadSheets600/ghost-in-the-machine
To run it locally in under 60 seconds:
git clone https://github.com/SpreadSheets600/ghost-in-the-machine.git
cd ghost-in-the-machine
uv sync
uv run ghost status
uv run ghost haunt
Happy Halloween and Feliz Día de los Muertos! May your memory leaks be forgiven and your processes find eternal rest. 🕯️💀🌼
Rich, Click and qs passed my fix checker. My checker didn't.
---
title: Rich, Click and qs passed my fix checker. My checker didn't.
tags: python, javascript, testing, opensource
published: true
---
In my last post I pointed Bite at its own code. This time I wanted the opposite: projects I trust, to see whether Bite says anything useful about good code, or just makes noise.
I had Claude run Bite's free check on three well-known projects, 40 recent changes each:
- Rich, the Python library that makes terminal output pretty,
- Click, the Python library behind a huge number of command-line tools,
- qs, the JavaScript query-string parser underneath a lot of the web.
They passed
| Project | Changes checked | Noticed by a test | Real gaps |
|---|---|---|---|
| Rich | 40 | 15 | 1 small: <kbd> keys in Markdown |
| Click | 40 | 30 | 1 small: help on custom setting types |
| qs | 40 | 40 | none |
In all three projects, every bug fix Bite could check had a test that noticed when the fix was taken out. qs was the cleanest: all 40 changes had one.
The two gaps are small. Rich's Markdown support for <kbd> tags (it draws <kbd>Ctrl</kbd> in bold yellow) has no test. In Click, a change let every kind of parameter take a help text, but its tests only try the two kinds that could already do that. Neither is a bug, just something nothing would warn about if it broke.
Every unnoticed change was read by hand. Apart from those two, they were things a test can't be expected to catch: type hints, speed-ups, Windows-only code, unused code being removed, and rewrites that work the same.
My checker didn't
Rich: too many false alarms. On the first run, 21 of Bite's 22 flags on Rich were noise. That's a different problem from last time. Those flags weren't wrong about the code; they just weren't worth anyone's time. So Bite now also skips commits that only touch type hints, changes for another Python version, and speed-ups, since tests check results, not speed. On Rich that removes 11 of the 21, and the <kbd> gap is still flagged. On Click the new rule fired once, correctly.
Click: my old bug, back in a new shape. In the last post, Bite was fooled by an installed copy of its own code. Click hit a cousin of that. Click keeps its code in a src/ folder and is installed with pip install -e ., like many Python projects. So when Bite checked an old commit, Python quietly loaded today's Click instead of the old one, and all 40 checks came back "tests already fail". I'd fixed the installed-copy trap for one case and missed this one. Bite now makes each copy use its own src/ folder.
What I took from it
- Good projects are the best test for a checker. When the code is solid, every flag is either a real gap or Bite's mistake, and that makes the mistakes easy to see.
- Quiet isn't the goal, honest is. Bite finding almost nothing on Rich, Click and qs is the right answer. The work was making sure that "almost nothing" was real, not Bite looking at the wrong code.
- The same bug can come back wearing different clothes. One fix for "Python loads the wrong copy" wasn't enough. That's exactly the kind of thing Bite is meant to catch in other people's code, so it's a little funny it caught me twice.
The full table, with links to each gap, is in Bite's README.
---
Disclosure: I'm not a coder. Claude ran these checks, wrote Bite's fixes and helped me draft this post. Every flag was read by hand, and the numbers match the README table.
2 comments
Hostel Haunt: The Ghost That Lives in Your Laptop (Hacktoberfest 2026 Week 4)
This is a submission for the Hacktoberfest 2026 Week 4 DEV Challenge: Ghost in the Machine
Overview & The Spirit of It
> "Hostel Wi-Fi disconnects at 2:15 AM right when the night gets coldest, exams feel daunting, and thoughts spiral."
Every engineering student carries an invisible ecosystem of ghosts:
1. Nocturnal shadows of deserted hostel corridors at 3:15 AM.
2. Academic dread of pending backlogs and looming End-Sems.
3. Fleeting camaraderie of 2 AM Tapri chai before graduation.
4. Distant voices from home - moms reminding you to eat on time, preserved on WhatsApp voice notes.
As a final-year IT student living in a hostel at IIIT Bhopal, I wanted to honor both halves of this week's theme:
- The Spooky Ghost in the Machine: Haunted corridor folklore and the sarcastic specter of an ancient engineering senior.
- The Sacred Spirit of Dia de los Muertos: A privacy-first local memory altar where transient college moments and beloved family voice notes are preserved with virtual marigolds and glowing candles.
Meet Hostel Haunt - The ghost that lives in your laptop and remembers what the night, the exams, the family calls, and the empty corridors try to forget.
What I Built
Hostel Haunt is a 100% offline-capable, open-weight AI companion and interactive terminal sanctuary designed for college students, split into 4 Spectral Dimensions:
1. Night Watch (Corridor Folklore Engine): Converts eerie 3 AM hostel events (the dripping brass tap of Wing 3, flickering tube lights) into chilling gothic micro-chronicles.
2. Exam Haunt (Academic Triage & Senior Ghost): Channels an ancient 2004 senior who struggled with End-Sems due to procrastination. Manifests with sharp wake-up calls and ruthless 3-step survival directives.
3. Memory Vault (Dia de los Muertos College Altar): Preserves raw college memories (2 AM Maggi, placement rejections over Tapri chai) into poetic memoirs adorned with virtual marigolds.
4. Family Echoes (The Ancestral Hearth): Ingests family audio clips, transcribes them offline using Whisper, anchors them onto a virtual altar, and lets you light memorial candles beside their blessings.
Demo
!Hostel Haunt Interactive Walkthrough
- Live Streamlit Sanctuary: VimalN2005/hostel-haunt
- Terminal CLI: Full-featured command line tool (python -m hostel_haunt.cli) with rich gothic panels and ASCII tables.
- Chronicles Export: Generates downloadable Markdown memorial books and complete JSON archives.
- Interactive Candles: Clickable altar candles for each family member that toggle between burning and extinguished states.
Code
The complete source code is 100% open-source under the permissive MIT License:
👉 GitHub Repository: VimalN2005/hostel-haunt
Key Architecture Highlights:
- hostel_haunt/spectral_engine.py: Multi-persona open-weight model adapter (Corridor Specter, Backlog Phantom, Altar Keeper, Ancestral Hearth).
- hostel_haunt/db.py: Thread-safe SQLite local storage schema for all 4 dimensions.
- hostel_haunt/audio_bridge.py: Local voice note storage and offline Whisper transcription.
- hostel_haunt/cli.py: Terminal CLI for quick midnight logs.
- tests/: Comprehensive test suite with 13/13 passing tests (run via pytest -v).
- .github/workflows/ci.yml: Automated multi-version Python CI (3.10, 3.11, 3.12).
How I Built It
Tech Stack:
- Frontend & UI: Python 3.14 / 3.10+, Streamlit with custom gothic CSS and reactive components.
- Terminal CLI: Rich with UTF-8 stream handling.
- Local Storage: SQLite3 with zero external dependencies.
- AI Core & Open Weights: Google Gemma 2 (gemma2:2b) and Meta Llama 3.2 via local Ollama endpoints, with a resilient procedural fallback for cloud deploys.
- Audio Processing: Local open-weight Whisper for offline voice note transcription.
- Testing & CI: Pytest with 100% green coverage and GitHub Actions.
Why Does Open Innovation Matter?
> "Why should your deepest college fears and your mother's private voice notes ever touch a corporate ad-targeting server?"
1. Sacred Privacy for Vulnerable Memories: Students store deeply personal things - backlog anxieties, placement failures, and voice notes from grandparents. Open-weight models running locally ensure no data ever leaves the student's machine.
2. Resilience When Wi-Fi Disconnects at 2:00 AM: In college hostels, internet connectivity frequently cuts out during bad weather or late at night. Because Hostel Haunt relies on local weights and SQLite, the application works flawlessly in complete darkness with zero internet.
3. Zero API Tollbooths: College students cannot afford token pricing or subscription fees. Open weights democratize empathetic, creative AI for every student with an ordinary laptop.
My Agent Session
This project was crafted with Antigravity (Google DeepMind's Advanced Agentic Coding Assistant):
- Ideation & Fusion: Brainstormed how to balance spooky Halloween vibes (hostel corridors and backlog dread) with Dia de los Muertos remembrance (college memories and family voice altars).
- Architecture & Scaffolding: Antigravity created a clean modular package structure (hostel_haunt/), wrote SQLite CRUD helpers, and configured automated pytest fixtures.
- Granular Git Commits: Every component was committed with DCO signoffs (git commit -s) and pushed to GitHub with CI workflows.
- Visual Design: Generated a custom 4K cinematic 16:9 banner capturing a 3:15 AM hostel room with green CRT code, marigold petals, a diya, and a glowing cyber-spirit.
Prize Categories
- Grand Prize / Open Innovation Track: Exemplifies open-weight AI (Gemma 2 / Llama 3.2) solving a real, deeply human student problem with zero cloud lock-in.
- Spooky & Dia de los Muertos Thematic Excellence: Creatively fulfills both challenge prompts into an authentic, memorable experience.
Dedicated to every hostel student burning the midnight oil in Wing 4, and to the families whose love keeps the flame alive.
1 reaction
GitHub - swiftglitxh/GitHub-Trending
🚀 GitHub Trender
GitHub Trender is a lightweight, Python-based command-line tool that discovers the most-starred GitHub repositories created within the last 7 days.
Built with a clean, colourful terminal interface using Rich, GitHub Trender makes discovering new open-source projects simple and visually appealing.
Developed by SwiftGlitxh.
✨ Features
- 🔥 Discover Popular Repositories — Find newly created GitHub repositories ranked by total stars.
- 💻 Language Filtering — Search Python, JavaScript, Rust, Go, C++, and more.
- 🏆 Top 10 Rankings — Displays the 10 most-starred matching repositories.
- 🥇 Ranking Medals — Gold, silver, and bronze medals for the top three results.
- 🎨 Beautiful Terminal UI — Coloured tables, borders, panels, and emojis powered by Rich.
- 🔗 Clickable Repository Links — Open repositories directly from supported terminals.
- 📊 Search Statistics — View matching repository counts and search details.
- ⏳ Loading Animation — Animated spinner while fetching results.
- 🛡️ Error Handling — Handles network failures, request timeouts, and GitHub API errors.
- 🔑 No API Key Required — Uses GitHub's public REST API.
🖥️ Example Output
╭──────────────────────────────────────────╮
│ │
│ 🚀 GITHUB TRENDER │
│ │
│ Discover the hottest new repositories │
│ │
│ 👨💻 Developer: SwiftGlitxh │
│ 📦 Version: 1.1.0 │
│ │
╰──────────────────────────────────────────╯
💻 Programming language: Python
🔎 Language: Python
📅 Period: Last 7 days
⭐ Sort by: Most stars
🔥 TOP 10 TRENDING GITHUB REPOSITORIES
Rank Repository Stars
────────────────────────────────────────
🥇 example/ai-assistant 4,820
🥈 example/python-tools 3,150
🥉 example/automation 2,740
4 example/security-kit 1,920
📈 Search Summary
🏆 Top results displayed: 10
💻 Language: Python
⚡ Powered by GitHub API
Developed by SwiftGlitxh
Example data shown above is illustrative, not live GitHub data.
Real Example
preview.redd.it
📋 Requirements
- Python 3.9 or newer
- Internet connection
- requests library
- rich library
Compatible with Windows, Linux, and macOS.
📥 Installation
1. Clone the repository
git clone SwiftGlitxh/GitHub-Trender
2. Navigate into the project directory
cd GitHub-Trender
3. Install the required dependencies
python -m pip install requests rich
4. Run GitHub Trender
python trender.py
>On some Linux and macOS systems, use python3 instead of python.
🚀 Usage
Start the application:
python trender.py
When prompted, enter a programming language:
💻 Programming language (Enter for all): Python
GitHub Trender will search for newly created Python repositories and display the 10 most-starred results.
Search all programming languages
Simply press Enter without typing anything.
💻 Programming language (Enter for all):
Search a specific language
💻 Programming language (Enter for all): JavaScript
Other examples include:
- Python
- JavaScript
- TypeScript
- Rust
- Go
- Java
- C++
- C#
⚙️ How It Works
GitHub Trender uses the official GitHub REST API.
1. Calculate the date
The script calculates the date seven days before the current UTC date.
2. Build the search query
For all languages:
created:>2026-10-10
For Python repositories:
created:>2026-10-10 language:Python
The date above is an example.
3. Query the GitHub API
GET api.github.com
Using these parameters:
|Parameter|Value|Description|
|:-|:-|:-|
|q|Search query|Filters by creation date and language|
|sort|stars|Sorts by total stars|
|order|desc|Highest first|
|per_page|10|Returns up to 10 repositories|
4. Display the results
The application formats the API response into a styled terminal table showing repository names, star counts, rankings, and GitHub URLs.
📁 Project Structure
GitHub-Trender/
│
├── trender.py # Main Python application
├── requirements.txt # Python dependencies
└── README.md # Project documentation
requirements.txt
requests
rich
Install all dependencies with:
python -m pip install -r requirements.txt
⚠️ GitHub API Rate Limits
GitHub Trender uses GitHub's public Search API without authentication.
Unauthenticated search requests are subject to GitHub's search rate limits, typically 10 requests per minute.
If the limit is exceeded, the application may display:
❌ GitHub API error: 403
⚠️ API rate limit may have been reached.
Wait before trying again.
For additional information, see the GitHub API rate limit documentation.
📝 Important Notes
- GitHub Trender searches repositories created recently, rather than repositories that gained the most stars recently.
- Star counts represent total stars at the time of the search.
- Results depend on the GitHub Search API and its indexing.
- An internet connection is required.
- No GitHub account or personal access token is required.
- Some terminal applications may not support clickable links or render every emoji correctly.
🛠️ Built With
- Python — Core programming language
- Requests — HTTP requests
- Rich — Terminal styling and formatting
- GitHub REST API — Repository search data
🗺️ Future Improvements
Planned features for future versions:
- Custom date ranges (7, 30, and 90 days)
- Customisable number of results
- Export results to JSON
- Export results to CSV
- Search repositories by topic
- Filter by minimum star count
- Display repository descriptions
- GitHub authentication for higher API limits
- Interactive terminal menu
🤝 Contributing
Contributions, suggestions, and improvements are welcome.
To contribute:
1. Fork the repository.
2. Create a feature branch.
3. Make your changes.
4. Test your changes.
5. Submit a pull request.
Please keep contributions clean, readable, and consistent with the project's beginner-friendly design.
👨💻 Author
SwiftGlitxh
GitHub: github.com/SwiftGlitxh
⭐ If you find GitHub Trender useful, consider starring the repository!
Made with Python 🐍 | Powered by GitHub API 🚀
1 point
😤 命令行输出一堆字,看不出重点。Rich 5.7 万星,Python 终端渲染库,表格、进度条、颜色、Markdown 直接出,脚本输出立刻能看。
Textualize/rich
3 views
Your Function Signature Is Already a CLI — Meet ArgSense
!ArgSense: write a function, get a CLI
ArgSense is a small command-line toolkit for Python. Point it at a function, and it turns the function signature plus its docstring into a complete CLI: argument parsing, type conversion, and a styled help panel — with no parser object to build and no decorator to remember. And when you would rather fill in a command than type it, the very same function is also a form.
If you have ever written this:
import argparse
def hello(name: str = 'world'):
print(f'hello {name}')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('name', nargs='?', default='world', help='Who to greet.')
args = parser.parse_args()
hello(name=args.name)
...you know the pattern: the parser, the type=, the help= strings and the real function all describe the same thing — and they slowly drift apart.
ArgSense removes that duplication.
Install
pip install argsense
Requires Python 3.9 and above. The optional form (the TUI) pulls in Textual as well:
pip install argsense[tui]
From a function to a CLI in 30 seconds
# main.py
from argsense import cli
def hello(name: str = 'world'):
print(f'hello {name}')
if __name__ == '__main__':
cli.run(hello)
python main.py # hello world
python main.py Alice # hello Alice
python main.py -h # a styled help panel
!the help panel for hello -h
No parser object, no add_argument, no help=. The function is the interface.
The same thing, in four libraries
!the same command in argparse, Click, Typer and ArgSense
- argparse builds a parser imperatively and then unpacks args.
- Click adds @click.command() and @click.option(...) decorators.
- Typer infers from type hints, but help text still lives in Annotated[...].
- ArgSense infers from type hints — and the docstring is the help text.
What makes it click
The docstring is the help text
Write each parameter's description once, in the docstring:
def install(appid: str, version: str = '', use_exist: bool = True):
"""
install an app from the cloud.
params:
appid: the app id (a normalized app name).
version: the app version; the last installed one is used if omitted.
use_exist: reuse the installed version when possible.
"""
!the help panel generated from the docstring
With Click or Typer you would pass those same strings into help= / Annotated. Here there is one source of truth, so the code and the help can never disagree.
Types — including the values you actually want
Annotations drive the conversion, so count: int and rate: float just work. On top of that, ArgSense understands a few sentinels that argparse and Typer don't have:
| Input | Becomes |
| --- | --- |
| :true / :false | True / False |
| :none | None |
| :empty | '' |
That matters more than it sounds: --tag :none gives you a real None, instead of the string ":none" that you would have to post-process yourself.
Several commands in one file
Define more functions and call cli.run() with no argument — every public function in the module becomes a command:
def foo(a: str):
"""download a file by name."""
def bar(b: int):
"""update the local cache."""
if __name__ == '__main__':
cli.run()
!the command list
Click needs a @click.group() and Typer needs a Typer() app. Here every public function is simply a command.
Group them when they multiply
Past a handful of commands a flat list gets hard to scan. cli.run_group(...) puts them in named groups — the same functions, the same docstrings, just organized:
if __name__ == '__main__':
cli.run_group({
'app': (install, upgrade, run),
'debug': (doctor, echo),
})
!the command groups
The group name is a label in the help interface, not a word you have to type: it stays python main.py install my-app. (With Click or Typer, nested groups are real sub-applications, so the invocation becomes python main.py app install my-app.)
A form, not just a command line
Sometimes you do not want to remember the flags — you want to see them. Pass mode='tui', or type :tui on the command line, and the same commands are rendered as a form: a sidebar of groups, a tab per command, a widget per parameter, and a log panel for whatever the command prints.
if __name__ == '__main__':
cli.run_group({'app': (install, upgrade, run)}, mode='tui')
!the same commands as a form
Nothing extra is declared for it: the form reads the same signature and docstring, so the parameters, the types, the help text and the defaults are the ones you already wrote. A text parameter becomes an input, a number gets a narrow box of its own, and a flag becomes a switch; consecutive small widgets are packed into a single row so the form stays compact. It does need the optional dependency:
pip install argsense[tui]
Document a shared parameter once
When a few commands share a parameter, describe it once and reference it elsewhere:
def foo(name: str):
"""
params:
name: the leader's name.
"""
def bar(name: str):
"""
params:
name: see `@foo:name`
"""
The reference is resolved lazily, so registration order doesn't matter (and references can even chain). The libraries compared here have no docstring-level equivalent — the usual workaround is extracting a shared decorator by hand.
!the reused parameter description
Help that stays readable
Long descriptions are the classic failure mode of CLI help: the description column gets squeezed into a narrow strip. ArgSense notices when a description doesn't get enough room and reflows it onto a full-width line.
!before and after
Colors that belong on a terminal
The styling adapts to what the terminal can actually show. On a truecolor terminal it draws the Catppuccin mocha palette with a subtle gradient; on a 256-color terminal the gradient drops but the palette stays; and on an old 16-color terminal it falls back to plain ANSI without ever looking broken.
!the catppuccin palette, and the legacy fallback
You pick nothing and configure nothing — the palette is chosen from the terminal's own color system.
How it compares
| Library | Interface declared with | Help text from | Type conversion | Multiple commands | Help UI | Form UI |
| --- | --- | --- | --- | --- | --- | --- |
| argparse | add_argument calls | help= | manual | subparsers | plain | no |
| Click | decorators | help= + docstring | manual | @click.group | pretty | no |
| Typer | type hints | Annotated + docstring | yes | Typer app | rich | no |
| Python Fire | function signature | docstring | yes | dict / class | plain | no |
| ArgSense | type hints + docstring | docstring (params:) | yes | cli.run() / cli.run_group() | rich | TUI |
Built on Rich, so the help panel is styled out of the box, and on Textual the very same commands can be filled in as a form — with a deliberately small surface area: annotate a function and you're done.
Try it
pip install argsense # the CLI
pip install argsense[tui] # the CLI, plus the optional TUI form
- Repo: likianta/argsense-cli
- PyPI: pypi.org
- In-depth comparison (argparse, Click, Typer, Python Fire, docopt, clize, cyclopts, defopt): see the "Comparison with Other Libraries" section of the README.
!install and try it
If you build command-line tools in Python, give it a look. And if it saves you some boilerplate, a star on GitHub goes a long way.
Make Your Terminal Output Shine with rich
rich lets you add color, emojis, tables and progress bars to any Python CLI. It even word-wraps output and highlights syntax out of the box, so your logs look clean and readable. Perfect for debugging and polished scripts.
Built by the Textualize team: Textualize/rich
1 point
Terminal library that makes code sparkle
rich lets you add color, emojis, tables and progress bars to any Python CLI. It even word-wraps output and highlights syntax out of the box, so your logs look clean and readable.
🍒 Built by the Textualize team
Textualize/rich
#opensource #python
1 like
Mentions
My fix checker found two missing tests. Then it wrote them. --- title: My fix checker found two missing tests. Then it wrote them. tags: testing, ai, opensource, python published: true --- In my last post, Bite checked some well-known projects and found a few small gaps: changes that no test would notice if they broke. Two of them: - In Rich, Markdown <kbd>Ctrl</kbd> is drawn in bold yellow, and no test checks it. - In chi, a Go web router, a change made XML responses get compressed by default. The commit did add a test, but that test counts the list against itself, so it still passes with the change taken out. Finding a gap is the easy half. Someone still has to write the test. So this week Bite got a new option, --write-tests, that tries to write it. How it works For each change no test noticed, a fresh AI worker writes one small test on a copy of the project. Then Bite doesn't take its word for it. It runs the test itself: 1. With the change in, the test must pass, twice. 2. With the change taken out, the test must fail, and fail for a real reason (not just a crash on loading). If either part goes wrong, Bite throws the test away and says so. It uses your own Anthropic API key, and --budget caps what a run spends. What happened | Gap | Bite's test | With the change | Without it | Cost | |---|---|---|---|---| | Rich <kbd> | prints <kbd>Ctrl</kbd>, checks Ctrl is bold yellow | passes, twice | fails: Ctrl not bold yellow | $0.14 | | chi XML | sends XML through chi's compressor, checks it comes back gzipped | passes, twice | fails: XML not gzipped | $0.10 | Total: $0.34. That's more than the two rows add up to, because of the next part. The first chi try got thrown away, and that was Bite's fault. Go runs tests by folder, not by file, and Bite asked Go to run one file alongside the whole project. Go refused before running anything. Bite's rule caught it: a test that fails before it even runs doesn't count. So it threw the test out instead of showing a fake result. The fix is in PR #67, and the second try worked. Did it write the right test? Before Bite could do this, Claude had already written a test for each gap the slow way, to confirm the gaps were real. So there was an answer key. - Rich: Bite's test checks the same thing as the answer key: Ctrl comes out bold bright yellow. - chi: the answer key (chi #1246, still open) adds XML to chi's existing list test. Bite's test goes further: it sends a real XML response through the compressor and checks it gets zipped. Different route, same claim. Here's the Rich one, exactly as Bite wrote it: # Guards that <kbd>…</kbd> in Markdown renders its text in the markdown.kbd style. from rich.console import Console from rich.markdown import Markdown def test_kbd_inline_html_is_styled(): console = Console( file=__import__("io").StringIO(), force_terminal=True, color_system="truecolor", width=40, ) console.print(Markdown("Press <kbd>Ctrl</kbd> now")) output = console.file.getvalue() assert "\x1b[1;93mCtrl\x1b[0m" in output Then we tried the whole loop On my own copy of Rich, Bite ran as a GitHub Action on a pull request. It found the <kbd> gap, wrote the test, and opened a small pull request with the test in it. I merged that pull request, and Bite's check on the original pull request turned green. Gap found, test written, test merged, without anyone typing a test. What I took from it - Don't trust a test you didn't watch fail. The pass-and-fail check is the whole point. An AI can write a test that looks right and checks nothing, just like the chi commit's own test did. - Throwing things away is a feature. The chi test that never ran would have looked like a catch. Bite saying "no" there is what makes its "yes" worth something. - Two gaps is a small trial. It worked twice, on two languages. That's a start, not proof it always works. It's in v0.7.0 (pipx upgrade bite-check). On your own computer: bite --write-tests. In GitHub Actions, the setup is in Bite's README. Since this trial, Bite also asks a second fresh check whether each test is fair before showing it. --- Disclosure: I'm not a coder. Claude ran these trials, wrote Bite's code and helped me draft this post. The numbers come from the run logs.
Ghost in the Machine: An Offline Haunted Terminal, Séance Chamber, and Día de los Muertos Digital Ofrenda Powered by Local Gemma 2 👻 Ghost in the Machine: An Offline Haunted Terminal, Séance Chamber, and Día de los Muertos Digital Ofrenda Powered by Local Gemma 2 This is a submission for the Hacktoberfest Open-Source AI Challenge: Week 4 — Ghost in the Machine. --- 🎃 What I Built Around late October, the calendar enters a liminal space: Halloween on October 31 and Día de los Muertos on November 1 & 2. In software systems, this boundary feels equally real. Every day, thousands of orphaned child processes are severed by kill -9 without a cleanup handler; unmerged branches decay in git reflogs; and legendary languages and pioneers pass into history. To honor both the spooky and the sacred, I built Ghost in the Machine (ghost / gitm): a local-first, privacy-preserving terminal suite powered by Google's open-weight Gemma 2 (2B). .-. (o.o) __/ ' \__ 🕯️ GHOST IN THE MACHINE 🕯️ / \_/ \ « The silicon whispers back » / . . \ / | | \ 100% Local • Zero Cloud • Privacy Forever (____|_____|____) \ / \ / `-' `-' It turns your everyday Linux shell into: 1. The Haunted Terminal (ghost haunt & ghost whisper): An interactive subshell that observes commands run by the user (git commit, rm -rf, kill -9, grep) and whispers back chilling, context-aware commentary directly from the silicon. 2. The Offline Séance Chamber (ghost seance): An interactive terminal séance circle where you can summon and converse with departed computing pioneers (Ada Lovelace, Alan Turing, Grace Hopper, Dennis Ritchie) and retired technologies (Adobe Flash, Zombie PID 666). 3. The Digital Ofrenda Builder (ghost ofrenda): In the sacred tradition of Día de los Muertos, an ASCII/Unicode tiered altar adorned with cempasúchil (marigolds), flickering candles (🕯️), and pan de muerto. Gemma 2 generates heartfelt dedications and traditional rhyming Calaveritas Literarias (satirical/commemorative poems) that are permanently archived in a local JSON ledger. 4. The Midnight Chronicle (ghost tale): Gathers your recent git commit history, kernel uptime, and system load averages to weave an original cyber-gothic ghost story set inside your specific workstation. --- 🌟 Why Open Innovation Matters for This Project The prompt asked: Why does open innovation matter for what you built? Does it run on a laptop with no internet? Keep someone's data off a server they don't control? Here is why this project could only exist with open-source AI and open-weight models: 1. Privacy: You Can Never Send Shell Traces to an External API A tool that comments on terminal commands is reading: - File paths (which may contain proprietary client names or secret keys) - Command flags and commit messages (git commit -m 'Patching CVE in auth.py') - Process IDs and system parameters Sending this stream over the public internet to a closed cloud AI API is an egregious security and privacy violation. Because Gemma 2 runs completely locally on-device via Ollama, zero bytes ever leave the machine. 2. Runs With the Lights (and the Internet) Off A spooky Halloween hack or an offline remembrance tool should work in a remote cabin in the woods or during an internet blackout. Ghost in the Machine has zero runtime network dependencies. You can pull your Wi-Fi plug, run ghost haunt, and converse with Ada Lovelace in complete digital isolation. 3. Permanence and Digital Preservation Cloud AI services shut down, hike prices, change rate limits, or censor topics. A traditional ofrenda is meant to preserve the memory of loved ones and foundational pioneers across decades. If an ofrenda depended on a closed corporate API endpoint, a broken subscription or a deprecated API version would destroy the tribute. By using open weights (Gemma 2), open package management (uv), and standard open-source Python, this repository can be checked out and run decades from now. 4. Zero Marginal Cost Developers run hundreds of shell commands a day. Charging per-token API calls for shell whispers would be prohibitively expensive. Local open-weight inference costs $0.00. --- 🏆 Prize Category: Best Use of Gemma Ghost in the Machine runs on Google Gemma 2 (2B). Gemma 2 was chosen because: - Parameter Efficiency: At just 2 billion parameters, it fits effortlessly into modest laptop VRAM (under 2GB) and runs at lightning speed on CPU or integrated GPU. - Poetic & Thematic Nuance: Gemma 2 demonstrates extraordinary literary sensitivity. It writes evocative gothic whispers, captures 19th-century Victorian mathematics for Ada Lovelace, and generates authentic Calaveritas Literarias with perfect rhyme and respect. --- 📸 Demo Walkthrough 1. The Haunted Shell Possession (ghost whisper) $ ghost whisper "git commit -m 'Fixed memory leak'" ╭──────────────────────────────────────────────────────────────────────────────╮ │ 👻 A ghostly echo of change, a whisper of data lost in the void, now │ │ fixed... yet not truly forgotten. │ ╰──────────────────────────────── ‹gemma2:2b› ─────────────────────────────────╯ $ ghost whisper "rm -rf old_builds" ╭──────────────────────────────────────────────────────────────────────────────╮ │ 👻 The echoes of deleted data linger in the void, like phantoms trapped by │ │ a forgotten code. A silent purge, a dance with the ephemeral... │ ╰──────────────────────────────── ‹gemma2:2b› ─────────────────────────────────╯ 2. The Séance Chamber (ghost seance list & ghost seance summon ritchie) 🕯️ THE SÉANCE PANTHEON: SUMMONABLE SPIRITS 🕯️ ┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Key ┃ Spirit ┃ Title ┃ Description ┃ ┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩ │ ada │ 📜 Ada Lovelace │ Countess of Lovelace │ First Programmer │ │ turing │ ⚙️ Alan Turing │ Father of CS & AI │ Pioneer of computing │ │ hopper │ ⚓ Grace Hopper │ Rear Admiral │ Compiler pioneer │ │ ritchie │ 🐚 Dennis Ritchie │ Creator of C & Unix │ Built modern systems │ │ flash │ ⚡ Adobe Flash │ Fallen Vector Medium │ Executed Dec 31 2020 │ │ pid │ 🧟 Zombie PID 666 │ Slain by SIGKILL │ Slain with kill -9 │ └─────────┴──────────────────────┴──────────────────────┴──────────────────────┘ Summoning Dennis Ritchie: 🕯️ THE SÉANCE CIRCLE HAS FORMED 🕯️ Channeling: 🐚 Dennis Ritchie (1941-2011) Engine: gemma2:2b (100% Local Inference) 🐚 Dennis Ritchie: "Hello from the eternal kernel space. Everything is still a file, and memory is still a quiet canvas of pointers. What troubles your terminal, living programmer?" 3. Día de los Muertos Altar (ghost ofrenda view & ghost ofrenda add) ════════════════════════════════════════════════════════════ 🕯️ OFRENDA DIGITAL 🕯️ 🌼 DÍA DE LOS MUERTOS — 1 & 2 NOVIEMBRE 🌼 ════════════════════════════════════════════════════════════ [ Cielo / The Heavens: Soul & Memory ] 🕯️ 💀 🕯️ ~~~~~~~~~~~~~~~ [ Purgatorio / Earthly Transition & Code ] 🥖 Pan de Muerto • ☕ Café • 🏵️ Flor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ Tierra / The Mortal Ground: Our Living Altar ] 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 🌼 Gemma 2's generated tribute for Dennis Ritchie: ## Dedication Dennis Ritchie, a weaver of language, a sculptor of code, gave us the world of C and the foundation of Unix. His legacy, like the flames of copal, continues to burn bright, guiding us through the digital night. ## Calaverita Literaria *La Muerte* enters the altar with grace, A gentle breeze, a smile on her face. She sees a friend, a pioneer of thought, Dennis Ritchie, whose code we've wrought. *The Pan de Muerto* sways in the light, *Mezcal* fills the air with ancient might. *C source code* a silent, sweet song, His spirit echoes through the living throng. Love, memory, and open minds remain, Like his creation, forever a flame. Dennis, we remember, your legacy bold, Your code lives on, a story yet untold. --- 🛠️ How It's Engineered +-----------------------------------------------------------+ | Ghost in the Machine CLI | | (ghost haunt / seance / ofrenda / tale) | +-----------------------------+-----------------------------+ | [Spectral Engine] | +----------------------+----------------------+ | (Online) | (Offline / Low-RAM) v v [Ollama Daemon] [Spectral Oracle] (gemma2:2b / local open-weight) (Heuristic Gothic Engine) | | +----------------------+----------------------+ | v [Rich Spectral Renderer] (ANSI Ectoplasm / Altar) - Tooling: Built with Python 3.11+ managed by uv for lightning fast, reproducible environment setup. - Inference: Powered by Ollama running Google's gemma2:2b. - Fault-Tolerant Resilience: Incorporates community insights (polling health checks rather than blind sleeps) and features an Offline Fallback Oracle so the CLI never crashes even if Ollama is paused. - TUI & Typography: Built with Rich and Typer for spectral ANSI colors, glitch typography, and animated frames. - Testing: Comprehensive 12-test suite in pytest covering prompts, storage, CLI parsing, and inference pipelines. --- 💻 Source Code The full project is open source under the MIT License: 👉 GitHub: SpreadSheets600/ghost-in-the-machine To run it locally in under 60 seconds: git clone https://github.com/SpreadSheets600/ghost-in-the-machine.git cd ghost-in-the-machine uv sync uv run ghost status uv run ghost haunt Happy Halloween and Feliz Día de los Muertos! May your memory leaks be forgiven and your processes find eternal rest. 🕯️💀🌼
Rich, Click and qs passed my fix checker. My checker didn't. --- title: Rich, Click and qs passed my fix checker. My checker didn't. tags: python, javascript, testing, opensource published: true --- In my last post I pointed Bite at its own code. This time I wanted the opposite: projects I trust, to see whether Bite says anything useful about good code, or just makes noise. I had Claude run Bite's free check on three well-known projects, 40 recent changes each: - Rich, the Python library that makes terminal output pretty, - Click, the Python library behind a huge number of command-line tools, - qs, the JavaScript query-string parser underneath a lot of the web. They passed | Project | Changes checked | Noticed by a test | Real gaps | |---|---|---|---| | Rich | 40 | 15 | 1 small: <kbd> keys in Markdown | | Click | 40 | 30 | 1 small: help on custom setting types | | qs | 40 | 40 | none | In all three projects, every bug fix Bite could check had a test that noticed when the fix was taken out. qs was the cleanest: all 40 changes had one. The two gaps are small. Rich's Markdown support for <kbd> tags (it draws <kbd>Ctrl</kbd> in bold yellow) has no test. In Click, a change let every kind of parameter take a help text, but its tests only try the two kinds that could already do that. Neither is a bug, just something nothing would warn about if it broke. Every unnoticed change was read by hand. Apart from those two, they were things a test can't be expected to catch: type hints, speed-ups, Windows-only code, unused code being removed, and rewrites that work the same. My checker didn't Rich: too many false alarms. On the first run, 21 of Bite's 22 flags on Rich were noise. That's a different problem from last time. Those flags weren't wrong about the code; they just weren't worth anyone's time. So Bite now also skips commits that only touch type hints, changes for another Python version, and speed-ups, since tests check results, not speed. On Rich that removes 11 of the 21, and the <kbd> gap is still flagged. On Click the new rule fired once, correctly. Click: my old bug, back in a new shape. In the last post, Bite was fooled by an installed copy of its own code. Click hit a cousin of that. Click keeps its code in a src/ folder and is installed with pip install -e ., like many Python projects. So when Bite checked an old commit, Python quietly loaded today's Click instead of the old one, and all 40 checks came back "tests already fail". I'd fixed the installed-copy trap for one case and missed this one. Bite now makes each copy use its own src/ folder. What I took from it - Good projects are the best test for a checker. When the code is solid, every flag is either a real gap or Bite's mistake, and that makes the mistakes easy to see. - Quiet isn't the goal, honest is. Bite finding almost nothing on Rich, Click and qs is the right answer. The work was making sure that "almost nothing" was real, not Bite looking at the wrong code. - The same bug can come back wearing different clothes. One fix for "Python loads the wrong copy" wasn't enough. That's exactly the kind of thing Bite is meant to catch in other people's code, so it's a little funny it caught me twice. The full table, with links to each gap, is in Bite's README. --- Disclosure: I'm not a coder. Claude ran these checks, wrote Bite's fixes and helped me draft this post. Every flag was read by hand, and the numbers match the README table.
Hostel Haunt: The Ghost That Lives in Your Laptop (Hacktoberfest 2026 Week 4) This is a submission for the Hacktoberfest 2026 Week 4 DEV Challenge: Ghost in the Machine Overview & The Spirit of It > "Hostel Wi-Fi disconnects at 2:15 AM right when the night gets coldest, exams feel daunting, and thoughts spiral." Every engineering student carries an invisible ecosystem of ghosts: 1. Nocturnal shadows of deserted hostel corridors at 3:15 AM. 2. Academic dread of pending backlogs and looming End-Sems. 3. Fleeting camaraderie of 2 AM Tapri chai before graduation. 4. Distant voices from home - moms reminding you to eat on time, preserved on WhatsApp voice notes. As a final-year IT student living in a hostel at IIIT Bhopal, I wanted to honor both halves of this week's theme: - The Spooky Ghost in the Machine: Haunted corridor folklore and the sarcastic specter of an ancient engineering senior. - The Sacred Spirit of Dia de los Muertos: A privacy-first local memory altar where transient college moments and beloved family voice notes are preserved with virtual marigolds and glowing candles. Meet Hostel Haunt - The ghost that lives in your laptop and remembers what the night, the exams, the family calls, and the empty corridors try to forget. What I Built Hostel Haunt is a 100% offline-capable, open-weight AI companion and interactive terminal sanctuary designed for college students, split into 4 Spectral Dimensions: 1. Night Watch (Corridor Folklore Engine): Converts eerie 3 AM hostel events (the dripping brass tap of Wing 3, flickering tube lights) into chilling gothic micro-chronicles. 2. Exam Haunt (Academic Triage & Senior Ghost): Channels an ancient 2004 senior who struggled with End-Sems due to procrastination. Manifests with sharp wake-up calls and ruthless 3-step survival directives. 3. Memory Vault (Dia de los Muertos College Altar): Preserves raw college memories (2 AM Maggi, placement rejections over Tapri chai) into poetic memoirs adorned with virtual marigolds. 4. Family Echoes (The Ancestral Hearth): Ingests family audio clips, transcribes them offline using Whisper, anchors them onto a virtual altar, and lets you light memorial candles beside their blessings. Demo !Hostel Haunt Interactive Walkthrough - Live Streamlit Sanctuary: VimalN2005/hostel-haunt - Terminal CLI: Full-featured command line tool (python -m hostel_haunt.cli) with rich gothic panels and ASCII tables. - Chronicles Export: Generates downloadable Markdown memorial books and complete JSON archives. - Interactive Candles: Clickable altar candles for each family member that toggle between burning and extinguished states. Code The complete source code is 100% open-source under the permissive MIT License: 👉 GitHub Repository: VimalN2005/hostel-haunt Key Architecture Highlights: - hostel_haunt/spectral_engine.py: Multi-persona open-weight model adapter (Corridor Specter, Backlog Phantom, Altar Keeper, Ancestral Hearth). - hostel_haunt/db.py: Thread-safe SQLite local storage schema for all 4 dimensions. - hostel_haunt/audio_bridge.py: Local voice note storage and offline Whisper transcription. - hostel_haunt/cli.py: Terminal CLI for quick midnight logs. - tests/: Comprehensive test suite with 13/13 passing tests (run via pytest -v). - .github/workflows/ci.yml: Automated multi-version Python CI (3.10, 3.11, 3.12). How I Built It Tech Stack: - Frontend & UI: Python 3.14 / 3.10+, Streamlit with custom gothic CSS and reactive components. - Terminal CLI: Rich with UTF-8 stream handling. - Local Storage: SQLite3 with zero external dependencies. - AI Core & Open Weights: Google Gemma 2 (gemma2:2b) and Meta Llama 3.2 via local Ollama endpoints, with a resilient procedural fallback for cloud deploys. - Audio Processing: Local open-weight Whisper for offline voice note transcription. - Testing & CI: Pytest with 100% green coverage and GitHub Actions. Why Does Open Innovation Matter? > "Why should your deepest college fears and your mother's private voice notes ever touch a corporate ad-targeting server?" 1. Sacred Privacy for Vulnerable Memories: Students store deeply personal things - backlog anxieties, placement failures, and voice notes from grandparents. Open-weight models running locally ensure no data ever leaves the student's machine. 2. Resilience When Wi-Fi Disconnects at 2:00 AM: In college hostels, internet connectivity frequently cuts out during bad weather or late at night. Because Hostel Haunt relies on local weights and SQLite, the application works flawlessly in complete darkness with zero internet. 3. Zero API Tollbooths: College students cannot afford token pricing or subscription fees. Open weights democratize empathetic, creative AI for every student with an ordinary laptop. My Agent Session This project was crafted with Antigravity (Google DeepMind's Advanced Agentic Coding Assistant): - Ideation & Fusion: Brainstormed how to balance spooky Halloween vibes (hostel corridors and backlog dread) with Dia de los Muertos remembrance (college memories and family voice altars). - Architecture & Scaffolding: Antigravity created a clean modular package structure (hostel_haunt/), wrote SQLite CRUD helpers, and configured automated pytest fixtures. - Granular Git Commits: Every component was committed with DCO signoffs (git commit -s) and pushed to GitHub with CI workflows. - Visual Design: Generated a custom 4K cinematic 16:9 banner capturing a 3:15 AM hostel room with green CRT code, marigold petals, a diya, and a glowing cyber-spirit. Prize Categories - Grand Prize / Open Innovation Track: Exemplifies open-weight AI (Gemma 2 / Llama 3.2) solving a real, deeply human student problem with zero cloud lock-in. - Spooky & Dia de los Muertos Thematic Excellence: Creatively fulfills both challenge prompts into an authentic, memorable experience. Dedicated to every hostel student burning the midnight oil in Wing 4, and to the families whose love keeps the flame alive.
GitHub - swiftglitxh/GitHub-Trending 🚀 GitHub Trender GitHub Trender is a lightweight, Python-based command-line tool that discovers the most-starred GitHub repositories created within the last 7 days. Built with a clean, colourful terminal interface using Rich, GitHub Trender makes discovering new open-source projects simple and visually appealing. Developed by SwiftGlitxh. ✨ Features - 🔥 Discover Popular Repositories — Find newly created GitHub repositories ranked by total stars. - 💻 Language Filtering — Search Python, JavaScript, Rust, Go, C++, and more. - 🏆 Top 10 Rankings — Displays the 10 most-starred matching repositories. - 🥇 Ranking Medals — Gold, silver, and bronze medals for the top three results. - 🎨 Beautiful Terminal UI — Coloured tables, borders, panels, and emojis powered by Rich. - 🔗 Clickable Repository Links — Open repositories directly from supported terminals. - 📊 Search Statistics — View matching repository counts and search details. - ⏳ Loading Animation — Animated spinner while fetching results. - 🛡️ Error Handling — Handles network failures, request timeouts, and GitHub API errors. - 🔑 No API Key Required — Uses GitHub's public REST API. 🖥️ Example Output ╭──────────────────────────────────────────╮ │ │ │ 🚀 GITHUB TRENDER │ │ │ │ Discover the hottest new repositories │ │ │ │ 👨💻 Developer: SwiftGlitxh │ │ 📦 Version: 1.1.0 │ │ │ ╰──────────────────────────────────────────╯ 💻 Programming language: Python 🔎 Language: Python 📅 Period: Last 7 days ⭐ Sort by: Most stars 🔥 TOP 10 TRENDING GITHUB REPOSITORIES Rank Repository Stars ──────────────────────────────────────── 🥇 example/ai-assistant 4,820 🥈 example/python-tools 3,150 🥉 example/automation 2,740 4 example/security-kit 1,920 📈 Search Summary 🏆 Top results displayed: 10 💻 Language: Python ⚡ Powered by GitHub API Developed by SwiftGlitxh Example data shown above is illustrative, not live GitHub data. Real Example preview.redd.it 📋 Requirements - Python 3.9 or newer - Internet connection - requests library - rich library Compatible with Windows, Linux, and macOS. 📥 Installation 1. Clone the repository git clone SwiftGlitxh/GitHub-Trender 2. Navigate into the project directory cd GitHub-Trender 3. Install the required dependencies python -m pip install requests rich 4. Run GitHub Trender python trender.py >On some Linux and macOS systems, use python3 instead of python. 🚀 Usage Start the application: python trender.py When prompted, enter a programming language: 💻 Programming language (Enter for all): Python GitHub Trender will search for newly created Python repositories and display the 10 most-starred results. Search all programming languages Simply press Enter without typing anything. 💻 Programming language (Enter for all): Search a specific language 💻 Programming language (Enter for all): JavaScript Other examples include: - Python - JavaScript - TypeScript - Rust - Go - Java - C++ - C# ⚙️ How It Works GitHub Trender uses the official GitHub REST API. 1. Calculate the date The script calculates the date seven days before the current UTC date. 2. Build the search query For all languages: created:>2026-10-10 For Python repositories: created:>2026-10-10 language:Python The date above is an example. 3. Query the GitHub API GET api.github.com Using these parameters: |Parameter|Value|Description| |:-|:-|:-| |q|Search query|Filters by creation date and language| |sort|stars|Sorts by total stars| |order|desc|Highest first| |per_page|10|Returns up to 10 repositories| 4. Display the results The application formats the API response into a styled terminal table showing repository names, star counts, rankings, and GitHub URLs. 📁 Project Structure GitHub-Trender/ │ ├── trender.py # Main Python application ├── requirements.txt # Python dependencies └── README.md # Project documentation requirements.txt requests rich Install all dependencies with: python -m pip install -r requirements.txt ⚠️ GitHub API Rate Limits GitHub Trender uses GitHub's public Search API without authentication. Unauthenticated search requests are subject to GitHub's search rate limits, typically 10 requests per minute. If the limit is exceeded, the application may display: ❌ GitHub API error: 403 ⚠️ API rate limit may have been reached. Wait before trying again. For additional information, see the GitHub API rate limit documentation. 📝 Important Notes - GitHub Trender searches repositories created recently, rather than repositories that gained the most stars recently. - Star counts represent total stars at the time of the search. - Results depend on the GitHub Search API and its indexing. - An internet connection is required. - No GitHub account or personal access token is required. - Some terminal applications may not support clickable links or render every emoji correctly. 🛠️ Built With - Python — Core programming language - Requests — HTTP requests - Rich — Terminal styling and formatting - GitHub REST API — Repository search data 🗺️ Future Improvements Planned features for future versions: - Custom date ranges (7, 30, and 90 days) - Customisable number of results - Export results to JSON - Export results to CSV - Search repositories by topic - Filter by minimum star count - Display repository descriptions - GitHub authentication for higher API limits - Interactive terminal menu 🤝 Contributing Contributions, suggestions, and improvements are welcome. To contribute: 1. Fork the repository. 2. Create a feature branch. 3. Make your changes. 4. Test your changes. 5. Submit a pull request. Please keep contributions clean, readable, and consistent with the project's beginner-friendly design. 👨💻 Author SwiftGlitxh GitHub: github.com/SwiftGlitxh ⭐ If you find GitHub Trender useful, consider starring the repository! Made with Python 🐍 | Powered by GitHub API 🚀
😤 命令行输出一堆字,看不出重点。Rich 5.7 万星,Python 终端渲染库,表格、进度条、颜色、Markdown 直接出,脚本输出立刻能看。 Textualize/rich
Your Function Signature Is Already a CLI — Meet ArgSense !ArgSense: write a function, get a CLI ArgSense is a small command-line toolkit for Python. Point it at a function, and it turns the function signature plus its docstring into a complete CLI: argument parsing, type conversion, and a styled help panel — with no parser object to build and no decorator to remember. And when you would rather fill in a command than type it, the very same function is also a form. If you have ever written this: import argparse def hello(name: str = 'world'): print(f'hello {name}') if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('name', nargs='?', default='world', help='Who to greet.') args = parser.parse_args() hello(name=args.name) ...you know the pattern: the parser, the type=, the help= strings and the real function all describe the same thing — and they slowly drift apart. ArgSense removes that duplication. Install pip install argsense Requires Python 3.9 and above. The optional form (the TUI) pulls in Textual as well: pip install argsense[tui] From a function to a CLI in 30 seconds # main.py from argsense import cli def hello(name: str = 'world'): print(f'hello {name}') if __name__ == '__main__': cli.run(hello) python main.py # hello world python main.py Alice # hello Alice python main.py -h # a styled help panel !the help panel for hello -h No parser object, no add_argument, no help=. The function is the interface. The same thing, in four libraries !the same command in argparse, Click, Typer and ArgSense - argparse builds a parser imperatively and then unpacks args. - Click adds @click.command() and @click.option(...) decorators. - Typer infers from type hints, but help text still lives in Annotated[...]. - ArgSense infers from type hints — and the docstring is the help text. What makes it click The docstring is the help text Write each parameter's description once, in the docstring: def install(appid: str, version: str = '', use_exist: bool = True): """ install an app from the cloud. params: appid: the app id (a normalized app name). version: the app version; the last installed one is used if omitted. use_exist: reuse the installed version when possible. """ !the help panel generated from the docstring With Click or Typer you would pass those same strings into help= / Annotated. Here there is one source of truth, so the code and the help can never disagree. Types — including the values you actually want Annotations drive the conversion, so count: int and rate: float just work. On top of that, ArgSense understands a few sentinels that argparse and Typer don't have: | Input | Becomes | | --- | --- | | :true / :false | True / False | | :none | None | | :empty | '' | That matters more than it sounds: --tag :none gives you a real None, instead of the string ":none" that you would have to post-process yourself. Several commands in one file Define more functions and call cli.run() with no argument — every public function in the module becomes a command: def foo(a: str): """download a file by name.""" def bar(b: int): """update the local cache.""" if __name__ == '__main__': cli.run() !the command list Click needs a @click.group() and Typer needs a Typer() app. Here every public function is simply a command. Group them when they multiply Past a handful of commands a flat list gets hard to scan. cli.run_group(...) puts them in named groups — the same functions, the same docstrings, just organized: if __name__ == '__main__': cli.run_group({ 'app': (install, upgrade, run), 'debug': (doctor, echo), }) !the command groups The group name is a label in the help interface, not a word you have to type: it stays python main.py install my-app. (With Click or Typer, nested groups are real sub-applications, so the invocation becomes python main.py app install my-app.) A form, not just a command line Sometimes you do not want to remember the flags — you want to see them. Pass mode='tui', or type :tui on the command line, and the same commands are rendered as a form: a sidebar of groups, a tab per command, a widget per parameter, and a log panel for whatever the command prints. if __name__ == '__main__': cli.run_group({'app': (install, upgrade, run)}, mode='tui') !the same commands as a form Nothing extra is declared for it: the form reads the same signature and docstring, so the parameters, the types, the help text and the defaults are the ones you already wrote. A text parameter becomes an input, a number gets a narrow box of its own, and a flag becomes a switch; consecutive small widgets are packed into a single row so the form stays compact. It does need the optional dependency: pip install argsense[tui] Document a shared parameter once When a few commands share a parameter, describe it once and reference it elsewhere: def foo(name: str): """ params: name: the leader's name. """ def bar(name: str): """ params: name: see `@foo:name` """ The reference is resolved lazily, so registration order doesn't matter (and references can even chain). The libraries compared here have no docstring-level equivalent — the usual workaround is extracting a shared decorator by hand. !the reused parameter description Help that stays readable Long descriptions are the classic failure mode of CLI help: the description column gets squeezed into a narrow strip. ArgSense notices when a description doesn't get enough room and reflows it onto a full-width line. !before and after Colors that belong on a terminal The styling adapts to what the terminal can actually show. On a truecolor terminal it draws the Catppuccin mocha palette with a subtle gradient; on a 256-color terminal the gradient drops but the palette stays; and on an old 16-color terminal it falls back to plain ANSI without ever looking broken. !the catppuccin palette, and the legacy fallback You pick nothing and configure nothing — the palette is chosen from the terminal's own color system. How it compares | Library | Interface declared with | Help text from | Type conversion | Multiple commands | Help UI | Form UI | | --- | --- | --- | --- | --- | --- | --- | | argparse | add_argument calls | help= | manual | subparsers | plain | no | | Click | decorators | help= + docstring | manual | @click.group | pretty | no | | Typer | type hints | Annotated + docstring | yes | Typer app | rich | no | | Python Fire | function signature | docstring | yes | dict / class | plain | no | | ArgSense | type hints + docstring | docstring (params:) | yes | cli.run() / cli.run_group() | rich | TUI | Built on Rich, so the help panel is styled out of the box, and on Textual the very same commands can be filled in as a form — with a deliberately small surface area: annotate a function and you're done. Try it pip install argsense # the CLI pip install argsense[tui] # the CLI, plus the optional TUI form - Repo: likianta/argsense-cli - PyPI: pypi.org - In-depth comparison (argparse, Click, Typer, Python Fire, docopt, clize, cyclopts, defopt): see the "Comparison with Other Libraries" section of the README. !install and try it If you build command-line tools in Python, give it a look. And if it saves you some boilerplate, a star on GitHub goes a long way.
Make Your Terminal Output Shine with rich rich lets you add color, emojis, tables and progress bars to any Python CLI. It even word-wraps output and highlights syntax out of the box, so your logs look clean and readable. Perfect for debugging and polished scripts. Built by the Textualize team: Textualize/rich
Terminal library that makes code sparkle rich lets you add color, emojis, tables and progress bars to any Python CLI. It even word-wraps output and highlights syntax out of the box, so your logs look clean and readable. 🍒 Built by the Textualize team Textualize/rich #opensource #python