How subzeroid/instagrapi works
Project type and purpose
• This is a Python client library (“instagrapi”) providing an unofficial wrapper for Instagram’s private Web & Mobile APIs.
• It offers core features (login, media upload/download, direct messaging, insights, challenge resolution, 2FA) via a modular mixin design.
• It includes documentation (MkDocs), examples, tests, Dockerized development & CI/CD workflows, and plugins for docs.
File structure
Top-level directories:
• instagrapi/ – the core library
• config.py, exceptions.py, extractors.py, image_util.py, utils.py, zones.py
• mixins/ – one module per IG feature (account, media, direct, story, etc.)
• types.py – data models for API responses
• story.py – StoryBuilder sub-system
• docs/ – MkDocs site source, usage-guide, best practices
• examples/ – standalone scripts demonstrating library usage
• tests.py – basic test suite
• util/ – MkDocs plugins (redirects, type-alias patch)
• docker/ + docker-compose.yml – dev/test environment
• .github/ – GitHub Actions workflows and custom actions (install deps, publish docs)
• setup.py, requirements*.txt – packaging & dependencies
README for additional insights
• Describes two API modes (Web vs Mobile) with auto-selection to avoid limits
• Highlights the “Challenge Resolver” subsystem (Email/SMS handlers, 2FA TOTP)
• Lists major resource types (User, Media, Comment, Story, Hashtag, Location, Direct)
• Shows sample code leveraging the Client() + mixins + types
Elements
• Developer → Client → HTTP Transport → Instagram Web/Mobile APIs
• HTTP errors → Challenge Resolver → Email/SMS gateways → back to Client
• Codebase + docs → MkDocs → GitHub Actions → Published docs
• Codebase → Docker/Test → GitHub Actions → PyPI
• Infrastructure (Docker, CI/CD, Docs) in another