Terminal Portfolio Site Project (code) in Python

← Back to Projects

Terminal Portfolio Site in Python

About the project: This is a terminal-based portfolio is a creative way to showcase your skills and personality.

This project is a Python script that simulates a command-line interface. When you run it, you'll see a terminal-style welcome message, and you can type commands like help, about, projects, and contact to navigate through the different sections of your portfolio.

The project code includes clear instructions on how to use it.


How to Run and Use the App

  1. Save the Code:Save the code above into a file named `portfolio.py`.
  2. Open Your Terminal: Open a terminal or command prompt window.
  3. Run the Script:Navigate to the directory where you saved the file and run the following command:
    
        python portfolio.py
        
  4. Interact:The program will start and display a welcome message. You can now type any of the available commands to explore the portfolio.

Project Level: Intermediate

You can directly copy the below snippet code with the help of green copy button, paste it and run it in any Python editor you have.

Steps: Follow these steps

Step 1: Copy below code using green 'copy' button.

Step 2: Paste the code on your chosen editor.

Step 3: Save the code with filename and .py extention.

Step 4: Run (Press F5 if using python IDLE).




# portfolio.py

import os
import sys
import time

# --- Portfolio Content ---
# This is a dictionary holding all the data for the portfolio.
# You can easily edit this content to personalize your portfolio.
PORTFOLIO_DATA = {
    "name": "Alex Johnson",
    "title": "Software Developer & Digital Artist",
    "about": (
        "Hello! My name is Alex. I'm a passionate software developer with a knack for "
        "solving complex problems and a love for creating beautiful, functional "
        "software. When I'm not coding, I enjoy digital art and exploring the "
        "intersection of technology and creativity."
    ),
    "projects": [
        {
            "name": "PyGame Asteroids",
            "description": "A classic arcade game built from scratch using the PyGame library. Features include dynamic asteroid generation, power-ups, and a high score system.",
            "link": "https://github.com/your-username/pygame-asteroids"
        },
        {
            "name": "Data Visualization Tool",
            "description": "A Python application that uses Matplotlib to generate interactive charts and graphs from CSV files, allowing for easy data analysis.",
            "link": "https://github.com/your-username/data-viz-tool"
        },
        {
            "name": "Terminal Chess",
            "description": "A two-player chess game played entirely in the terminal. The game includes basic move validation and a simple text-based board display.",
            "link": "https://github.com/your-username/terminal-chess"
        }
    ],
    "contact": (
        "You can reach me at:\n"
        "Email: your.email@example.com\n"
        "GitHub: https://github.com/your-username\n"
        "LinkedIn: https://linkedin.com/in/your-profile"
    ),
    "resume_link": "https://your-resume-link.com/resume.pdf"
}

# --- Command Handlers ---

def clear_screen():
    """Clears the terminal screen."""
    os.system('cls' if os.name == 'nt' else 'clear')

def typewriter_effect(text, delay=0.03):
    """
    Prints text with a typewriter effect for a retro terminal feel.
    
    Args:
        text (str): The string to print.
        delay (float): The delay between each character.
    """
    for char in text:
        sys.stdout.write(char)
        sys.stdout.flush()
        time.sleep(delay)
    print() # Add a newline at the end

def show_welcome():
    """Displays the welcome message and initial help text."""
    clear_screen()
    header = f"Welcome to {PORTFOLIO_DATA['name']}'s Terminal Portfolio!"
    underline = "=" * len(header)
    typewriter_effect(header, delay=0.01)
    typewriter_effect(underline, delay=0.01)
    print("\nType 'help' to see a list of commands.")
    print("--------------------------------------\n")

def show_help():
    """Displays all available commands."""
    print("Available commands:")
    print("  'about'    - Learn more about me.")
    print("  'projects' - View my portfolio of projects.")
    print("  'contact'  - Find my contact information.")
    print("  'resume'   - Get a link to my resume.")
    print("  'clear'    - Clear the terminal screen.")
    print("  'help'     - Show this list of commands.")
    print("  'exit'     - Quit the portfolio.")
    print()

def show_about():
    """Displays the 'About Me' section."""
    print("--- About Me ---")
    print(PORTFOLIO_DATA["about"])
    print()

def show_projects():
    """Displays the list of projects."""
    print("--- My Projects ---")
    for project in PORTFOLIO_DATA["projects"]:
        print(f"-> {project['name']}:")
        print(f"   Description: {project['description']}")
        print(f"   Link: {project['link']}")
        print()

def show_contact():
    """Displays the contact information."""
    print("--- Contact ---")
    print(PORTFOLIO_DATA["contact"])
    print()

def show_resume():
    """Displays the resume link."""
    print("--- Resume ---")
    print(f"Resume Link: {PORTFOLIO_DATA['resume_link']}")
    print()

def main_loop():
    """The main command loop for the terminal."""
    show_welcome()
    
    while True:
        command = input("portfolio> ").strip().lower()

        if command == "help":
            show_help()
        elif command == "about":
            show_about()
        elif command == "projects":
            show_projects()
        elif command == "contact":
            show_contact()
        elif command == "resume":
            show_resume()
        elif command == "clear":
            clear_screen()
            show_welcome()
        elif command in ["exit", "quit"]:
            print("Exiting portfolio. Goodbye!")
            break
        elif command == "":
            pass # Do nothing if the user just hits enter
        else:
            print(f"Error: Command '{command}' not found. Type 'help' for a list of commands.")
            print()

if __name__ == "__main__":
    main_loop()


This project is a great way to showcase your Python skills, especially if you plan to share your code on platforms like GitHub.
You can expand this project by adding more commands, or by implementing a more advanced feature like a simple text adventure game within the terminal.



← Back to Projects