A simple CLI tool to fetch popular movies from TMDB API, store locally in SQLite, cache raw JSON responses, and query movies with filters.
- Clone the repository:
git clone <your-repo-url>
cd repo
Install dependencies
Instead of pip install -r requirements.txt, you can do:
uv install -r requirements.txt
Run your CLI commands
Fetch movies:
uv run api_tool.py fetch --pages 3
Query movies:
uv run api_tool.py filter --title "Avengers" --popularity_gt 50 --limit 5
Rate-limiting & Pagination
TMDB free-tier allows 40 requests per 10 seconds.
Tool handles pagination using --pages.
Retry/backoff logic can be added for reliability.
Outputs
Raw cached JSON: cache/movie_<id>.json
Filtered JSON results: output/filtered_movies_<timestamp>.json