How megadose/toutatis works
Project type and purpose
• Project type: A Python-based command-line scraping tool (CLI application)
• Purpose: Given an Instagram username or ID and a valid session ID, extract public profile information (emails, phone numbers, follower counts, bio, etc.)
File structure
• setup.py – packaging script for PyPI/GitHub installation
• toutatis/ – root package
– __init__.py – initialization
– core.py – core logic and classes that perform HTTP requests, data parsing, and formatting
Key insights from the README
• The tool exposes two CLI commands (–u and –i) to trigger the same underlying logic
• Requires Python 3 and a valid session cookie from a logged-in Instagram session
• Outputs results to standard output in a formatted block
Main components
a. CLI Interface
– Argument parser (click, argparse, or custom)
– Commands “–u” and “–i” mapped to core functions
b. Core Engine (toutatis/core.py)
– Session Manager: accepts sessionID and attaches it to HTTP headers/cookies
– Request Layer: performs GET calls to Instagram endpoints (profile JSON or HTML)
– Data Parser: extracts fields (name, followers, email, phone, etc.) from response
– Formatter/Printer: formats the extracted fields into text output
c. External Service
– Instagram public API or web endpoints
d. Packaging & Deployment
– setup.py defines entry_point for CLI command “toutatis”
Relationships and interactions
• User invokes CLI → Argument Parser
• Parser calls Session Manager + Request Layer
• Request Layer interacts with Instagram over HTTPS
• Response flows into Data Parser → Formatter → STDOUT
Architectural patterns and design principles
• Separation of concerns – CLI parsing vs HTTP requests vs parsing vs formatting
• Single responsibility – each class or function in core.py handles one step
• Extensibility point – add new parsers or output formats without touching CLI logic
Elements
• Clear component labels: “CLI Parser”, “Session Manager”, “Request Layer”, “Data Parser”, “Formatter”
• Annotations for protocols (HTTPS) and data formats (JSON/HTML/text)