A sophisticated Python CLI application that generates a beautiful ASCII art digital business card with interactive URL shortening and clickable hyperlinks.
- Smart URL Shortening: Automatically converts long URLs to
cf.linkbranded short links - Terminal Hyperlinks: URLs are clickable in modern terminals while showing branded domains
- Progress Bar Interface: Professional countdown display with real-time server status
- Background HTTP Server: Seamless redirect handling for shortened URLs
- Zero External Dependencies: Uses only Python standard library
- Cross-Platform: Works on Windows, macOS, and Linux
- Thread-Safe: Concurrent URL shortening with SQLite backend
- Production Ready: Professional error handling and graceful degradation
pip install --user corefinder
corefindergit clone https://github.com/Corefinder89/corefinder.git
cd corefinder
pip install --use-feature=in-tree-build .
corefinderpython -m appcorefinder # Display interactive business card
corefinder --daemon # Run with persistent server
corefinder --version # Show version information
corefinder --help # Display helpcorefinder/
βββ app/
β βββ main.py # CLI & application orchestration
β βββ card.py # ASCII art generator
β βββ url_shortener.py # HTTP server & URL management
βββ tests/ # Test suite
β βββ debug_shortener.py # URL shortener debugging
β βββ test_redirect.py # HTTP redirect testing
β βββ test_main.py # Main application tests
βββ documentation/ # Technical documentation
The URL shortener creates professional branded links while maintaining full functionality through three core components:
- SQLite Database Storage (
url_shortener.db) - HTTP Redirect Server (runs on localhost:8888+)
- Terminal Hyperlink Generation
# 1. Original URL
original_url = "https://www.linkedin.com/in/soumyajit-basu/"
# 2. Generate unique short code
short_code = "a3Kx9P" # 6-character alphanumeric (62^6 combinations)
# 3. Store in SQLite database
CREATE TABLE urls (
id INTEGER PRIMARY KEY,
original_url TEXT NOT NULL,
short_code TEXT NOT NULL UNIQUE
)
# 4. Create terminal hyperlink
display_url = "http://cf.link/a3Kx9P" # What user sees
working_url = "http://localhost:8888/a3Kx9P" # Actual redirect URLCreates clickable links using ANSI escape sequences:
f"\033]8;;{working_url}\033\\{display_url}\033]8;;\033\\"Result: User sees branded cf.link/a3Kx9P but clicks open the original LinkedIn URL.
- User clicks: Terminal displays
cf.link/a3Kx9P - Terminal opens:
localhost:8888/a3Kx9P - Server extracts: Short code
a3Kx9P - Database lookup: Returns original LinkedIn URL
- HTTP 302 redirect: Browser opens original destination
- Final result: User reaches LinkedIn profile
- Primary port: 8888
- Fallback ports: 8889, 8890, 9000-9002
- Intelligent selection: Automatically finds available port
- Python 3.6+
- pip package manager
git clone https://github.com/Corefinder89/corefinder.git
cd corefinder
# Set up virtual environment
python -m venv .venv
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows
# Install in development mode
pip install -e .
# Run application
python -m appmake clean # Clean previous builds
make build # Build package
make publish # Publish to PyPI# Clean previous builds
rm -rf build/ dist/ *.egg-info/
# Build package
python -m pip install --upgrade build
python -m build
# Publish to PyPI
python -m twine upload dist/*# 1. Make changes to code
# 2. Test quickly
python -m app
# 3. Rebuild package
pip install -e . --force-reinstall
# 4. Test CLI
corefinderβ Supported Terminals:
- Windows Terminal
- VS Code Terminal
- iTerm2 (macOS)
- GNOME Terminal
β Unsupported Terminals:
- Old Windows Command Prompt
- Basic terminal emulators
Fallback: Shows display text as regular text in unsupported terminals.
- Standard Mode: 60-second runtime with progress visualization
- Daemon Mode: Persistent server for continuous operation
- Thread-safe: SQLite with concurrent access handling
- Collision prevention: Automatic uniqueness checking for short codes
- Scalability: Handles millions of URL records efficiently
- Memory: ~5-10MB typical usage
- CPU: Minimal (I/O bound operations)
- Storage: SQLite database scales with URL count
- Network: Single port HTTP server with fallback
- Thread Safety: Full thread-safe implementation
# Run all tests
python -m pytest tests/
# Debug URL shortener specifically
python tests/debug_shortener.py
# Test HTTP redirects
python tests/test_redirect.py
# Test main application
python tests/test_main.pyModule not found errors:
pip install --use-feature=in-tree-build . --force-reinstallServer port conflicts:
- URL shortener automatically tries alternative ports (8888-9002)
Changes not reflected:
pip install --use-feature=in-tree-build . --force-reinstall
corefinderUnicode/encoding errors during installation:
# Ensure setup.py reads files with UTF-8 encoding
with open('README.md', encoding='utf-8') as f:
long_description = f.read()- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
- Follow PEP 8 style guidelines
- Add tests for new functionality
- Update documentation for API changes
- Use type hints where appropriate
- All tests must pass
- New features require corresponding tests
- Maintain or improve code coverage
- Custom domain configuration
- URL analytics and click tracking
- RESTful API for programmatic access
- Web interface for URL management
- Theme customization for ASCII art
- Async HTTP server for better performance
- Configuration file support
- Plugin system for extensibility
- Docker containerization
- Author: Soumyajit Basu (@Corefinder89)
- GitHub: github.com/Corefinder89
- Email: soumyajit.basu62@gmail.com
- LinkedIn: soumyajit-basu-5a783886
- Issues: GitHub Issues
- Discussions: GitHub Discussions
This project is licensed under the MIT License - see the LICENSE file for details.
- β¨ Added Smart URL Shortening with cf.link branding
- π Terminal Hyperlinks for clickable URLs in modern terminals
- π Progress Bar Interface with real-time countdown
- π Daemon Mode for persistent server operation
- π HTTP Server with automatic port fallback
- π Enhanced Documentation with architecture overview
- π¨ Initial ASCII art business card display
- π» Basic CLI interface with help and version flags
- π Personal and professional information display
If you find this project useful:
- β Star the repository
- π Report bugs or issues
- π‘ Suggest new features
- π€ Contribute to the codebase
- π’ Share with others
Made with β€οΈ by Soumyajit Basu
