Command‑line Movie Database with OMDb API & Static Website Export
| Feature | Description |
|---|---|
| Add Movies | Fetch details from OMDb by title or fall back to manual entry |
| CRUD Operations | List, update, and delete movies stored in a SQLite database |
| Website Export | Generate a styled HTML website listing all movies from a customizable template |
| CLI Interface | Menu‑driven console app with input validation and error handling |
| Local Storage | Persistent movie data via SQLite + SQLAlchemy ORM |
CLI & Backend: Python + SQLAlchemy + SQLite
API: OMDb API (movie metadata)
Frontend: Static HTML/CSS website generated from template
Build: Pure Python, no heavy frameworks
# Clone & install
git clone https://github.com/seb0305/Movie-Project-SQL-HTML-API.git
cd Movie-Project-SQL-HTML-API
# Optional: create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set OMDb API key
# Edit storage/omdb_api.py and replace:
API_KEY = "YOUR_API_KEY" # Replace with your real key here
# Run the app
python movies.py- Choose "Add movie" from the menu.
- Enter a title; the app will try to fetch details from OMDb.
- If no result, fall back to manual entry (title, year, director, etc.).
- Use "List movies" to see all stored entries.
- Select "Update movie" to edit title, year, director, or notes.
- Use "Delete movie" to remove entries by ID.
- Select "Generate website" from the menu.
- The app reads the HTML template and CSS from
_static/. - Outputs a fresh
index.htmlin the project root showing all movies.
- Open
index.htmlin any browser. - The page lists movies with metadata and a clean, responsive layout.
- User input → Python CLI → SQLAlchemy ORM → SQLite (
data/movies.db) - On "Generate website": ORM query → Jinja‑style template fill →
index.html - OMDb API is called only when adding or refreshing a movie by title.
movies
id INTEGER PRIMARY KEY
title TEXT NOT NULL
year TEXT
director TEXT
genre TEXT
plot TEXT
poster_url TEXT
rating REAL
notes TEXT
- Web UI (Flask/Dash) instead of CLI
- Movie search & filters on the generated website
- Star‑rating & watch‑status fields
- Export to JSON or CSV
- Batch import from CSV/JSON
✅ Manual‑entry fallback when OMDb returns no result
✅ SQLite connection handling via SQLAlchemy
✅ Proper escaping of HTML‑unsafe fields in template
✅ CLI input validation (empty titles, invalid years)
# Add dev tools (optional)
pip install python-dotenv
# Run in debug mode (if you extend with a web layer)
python -m debugpy --listen 5678 movies.py-
Fork the repo and open a PR with:
-
New CLI commands (e.g., search, filter, export).
-
Improved OMDb error handling or caching.
-
Better templates or responsive CSS.
-
-
Bonus: add unit tests for storage/ modules.
MIT – Free for personal and educational use.
Built with ❤️ for movie‑loving Pythonistas.