Skip to main content

A sophisticated Python CLI application that generates a beautiful ASCII art digital business card with interactive URL shortening and clickable hyperlinks

Project description

Corefinder - Interactive Digital Business Card ๐ŸŽจ

Python Version License: MIT PyPI Version

A sophisticated Python CLI application that generates a beautiful ASCII art digital business card with interactive URL shortening and clickable hyperlinks.

Digital Business Card Preview

๐ŸŒŸ Key Features

โœจ Interactive Elements

  • Smart URL Shortening: Automatically converts long URLs to cf.link branded 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

๐Ÿ”ง Technical Excellence

  • 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

๐Ÿš€ Quick Start

Install from PyPI (Recommended)

pip install --user corefinder
corefinder

Development Installation

git clone https://github.com/Corefinder89/corefinder.git
cd corefinder
pip install --use-feature=in-tree-build .
corefinder

Direct Execution

python -m app

๐Ÿ’ป CLI Commands

corefinder                    # Display interactive business card
corefinder --daemon          # Run with persistent server
corefinder --version         # Show version information  
corefinder --help           # Display help

๐Ÿ—๏ธ Architecture Overview

Core Components

corefinder/
โ”œโ”€โ”€ 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

URL Shortening System Architecture

The URL shortener creates professional branded links while maintaining full functionality through three core components:

  1. SQLite Database Storage (url_shortener.db)
  2. HTTP Redirect Server (runs on localhost:8888+)
  3. Terminal Hyperlink Generation

๐Ÿ”ง How URL Shortening Works

Smart URL Mapping Process

# 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 URL

Terminal Hyperlinks with ANSI Escape Sequences

Creates 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.

HTTP Redirect Flow

  1. User clicks: Terminal displays cf.link/a3Kx9P
  2. Terminal opens: localhost:8888/a3Kx9P
  3. Server extracts: Short code a3Kx9P
  4. Database lookup: Returns original LinkedIn URL
  5. HTTP 302 redirect: Browser opens original destination
  6. Final result: User reaches LinkedIn profile

Automatic Port Management

  • Primary port: 8888
  • Fallback ports: 8889, 8890, 9000-9002
  • Intelligent selection: Automatically finds available port

๐Ÿ› ๏ธ Development Setup

Prerequisites

  • Python 3.6+
  • pip package manager

Local Development

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 app

Building for Distribution

Using Makefile (Unix/Linux/macOS)

make clean      # Clean previous builds
make build      # Build package
make publish    # Publish to PyPI

Manual Build (All Platforms)

# 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/*

Development Workflow

# 1. Make changes to code
# 2. Test quickly
python -m app

# 3. Rebuild package
pip install -e . --force-reinstall

# 4. Test CLI
corefinder

๐ŸŒŸ Advanced Features

Terminal Compatibility

โœ… 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.

Server Operation Modes

  • Standard Mode: 60-second runtime with progress visualization
  • Daemon Mode: Persistent server for continuous operation

Database Features

  • Thread-safe: SQLite with concurrent access handling
  • Collision prevention: Automatic uniqueness checking for short codes
  • Scalability: Handles millions of URL records efficiently

๐Ÿ“Š Performance Characteristics

  • 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

๐Ÿงช Testing

# 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.py

๐Ÿ› Troubleshooting

Common Issues

Module not found errors:

pip install --use-feature=in-tree-build . --force-reinstall

Server port conflicts:

  • URL shortener automatically tries alternative ports (8888-9002)

Changes not reflected:

pip install --use-feature=in-tree-build . --force-reinstall
corefinder

Unicode/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()

๐Ÿค Contributing

Development Process

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open Pull Request

Code Standards

  • Follow PEP 8 style guidelines
  • Add tests for new functionality
  • Update documentation for API changes
  • Use type hints where appropriate

Testing Requirements

  • All tests must pass
  • New features require corresponding tests
  • Maintain or improve code coverage

๐Ÿš€ Future Enhancements

Planned Features

  • Custom domain configuration
  • URL analytics and click tracking
  • RESTful API for programmatic access
  • Web interface for URL management
  • Theme customization for ASCII art

Technical Improvements

  • Async HTTP server for better performance
  • Configuration file support
  • Plugin system for extensibility
  • Docker containerization

๐Ÿ“ž Contact & Support

Support Channels

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“ Changelog

Version 1.2.7 (2025-10-02)

  • โœจ 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

Version 1.1.7

  • ๐ŸŽจ Initial ASCII art business card display
  • ๐Ÿ’ป Basic CLI interface with help and version flags
  • ๐Ÿ“‹ Personal and professional information display

๐ŸŒŸ Show Your Support

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

corefinder-1.2.9.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

corefinder-1.2.9-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file corefinder-1.2.9.tar.gz.

File metadata

  • Download URL: corefinder-1.2.9.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for corefinder-1.2.9.tar.gz
Algorithm Hash digest
SHA256 bb0d6f7f06c0b4be8f68b71444e3c2606687d10c7735633ad78522197c26acc9
MD5 52e7e928db432b8281a77ac837f10054
BLAKE2b-256 76f91e5bb5c3713fdef5a402c31c68d576e7e369e8bed857e217f71cd73f086f

See more details on using hashes here.

File details

Details for the file corefinder-1.2.9-py3-none-any.whl.

File metadata

  • Download URL: corefinder-1.2.9-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for corefinder-1.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 56e9a823ebdc56854274c7fdeb395288a089ee4b1474f750c1dcb46c350a1c57
MD5 7cb83abad3b61af59fe0b429aee68b76
BLAKE2b-256 81ac9558b5b9f721556622b9884404855ce270ffe9495c0d0cd062625226cf90

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page