How jeevan-gharate/instastra works
1. Repository purpose
- InstAstra is a small Python command-line Instagram scraper/downloader. Its core job is to take a profile identifier from the user, query Instagram through a Python library, and either print profile information or download media to local disk.
2. Main entrypoint
- InstAstra.py is the primary runtime entrypoint.
- It appears to implement the interactive user interface / menu flow and dispatches actions to the feature modules under funcs/.
3. Feature-oriented module split
- The funcs/ directory is the main application boundary for capabilities.
- Each file is a separate responsibility:
- ProfileDetails.py — fetches and displays profile metadata/details.
- ProfileDPDownload.py — downloads the profile display picture.
- ProfileStoriesDownload.py — downloads saved stories for a profile.
- allPostsDownload.py — downloads all posts from a profile.
4. Execution flow
- User starts the CLI from InstAstra.py.
- The CLI collects a target Instagram profile and the desired action.
- The selected function module performs the scraping/download task.
- Results are either printed to the terminal or written to the local filesystem as media files.
5. External dependency boundary
- The project depends on Instaloader, which is the key integration point with Instagram.
- Instaloader is the layer that handles Instagram interaction, metadata retrieval, and media download mechanics; the repo itself is mostly orchestration around that library.
6. Data and control flow
- Input is human-driven and interactive, not batch/API driven.
- Control flow is menu-based: the main script routes to one of the feature modules.
- Data flow is one-way from Instagram to the tool, then to console output and/or downloaded files on disk.
7. Local storage behavior
- The application is download-centric rather than database-centric.
- There is no indication of a server, persistent datastore, or background job system.
- Any outputs are likely stored as files in the working directory or a user-visible download path managed by Instaloader.
8. Build/setup path
- build.py is the setup/install helper referenced in the README.
- Its role is likely environment preparation: installing dependencies and/or configuring the tool before InstAstra.py is run.
- This makes the repo a simple two-step workflow: setup, then run the CLI.
9. Runtime and packaging
- The project is plain Python, intended to run with Python 3 on Linux or Windows.
- requirements.txt defines the dependency set, with Instaloader as the central package.
- The README’s Windows notes suggest the script invokes python3 explicitly in places, which matters for execution compatibility.
10. Architectural style
- This is a single-process, modular CLI utility.
- It is not a client-server system.
- The main architectural boundary is between the UI/orchestrator layer (InstAstra.py) and the feature/service layer (funcs/*.py), with Instaloader acting as the external integration layer.
11. What to show in an architecture diagram
- Show the user at the left, interacting with InstAstra.py.
- Show InstAstra.py delegating to the four feature modules.
- Show those modules depending on Instaloader.
- Show Instagram as the external system and the local filesystem as the output target for downloads.
12. Overall takeaway
- InstAstra is a compact, functionally split scraper/downloader with a single CLI entrypoint, a small set of feature modules, and one major third-party dependency that does the actual Instagram interaction.
Main entry points: InstAstra.py InstAstra CLI · ProfileDetails.py Profile details · ProfileDPDownload.py DP download · ProfileStoriesDownload.py Stories download
Components 12
Application
CLI entrypoint and feature modules inside the repo.
- InstAstra CLI · Main interactive script that collects a profile target and routes menu choices.
InstAstra.py - Profile details · Fetches and displays profile metadata.
funcs/ProfileDetails.py - DP download · Downloads a profile display picture.
funcs/ProfileDPDownload.py - Stories download · Downloads saved stories for a profile.
funcs/ProfileStoriesDownload.py - Posts download · Downloads all posts from a profile.
funcs/allPostsDownload.py - Build helper · Environment preparation and dependency setup before running the CLI.
build.py - Requirements · Python dependency list centered on Instaloader.
requirements.txt - README · Usage and setup guidance for running the tool.
README.md
External systems
Third-party service and local output targets.
- User · Interactive person running the CLI and choosing actions.
- Instaloader · Third-party library that handles Instagram access, metadata retrieval, and media downloading.
- Instagram · Source system being queried for profile data and media.
- Local files · Filesystem destination for downloaded media and generated output.
Connections 18
- User → InstAstra CLI: run / choose action · Interactive command-line usage starts here.
- InstAstra CLI → Profile details: profile info · Dispatches to the profile metadata feature.
- InstAstra CLI → DP download: download DP · Dispatches to the display-picture download feature.
- InstAstra CLI → Stories download: download stories · Dispatches to the stories download feature.
- InstAstra CLI → Posts download: download posts · Dispatches to the posts download feature.
- Profile details → Instaloader: query · Uses the library to fetch profile information.
- DP download → Instaloader: fetch media · Uses the library to retrieve profile images.
- Stories download → Instaloader: fetch stories · Uses the library to access story media.
- Posts download → Instaloader: fetch posts · Uses the library to access post media.
- Instaloader → Instagram: API access · Third-party library communicates with Instagram.
- Profile details → Local files: print / save · Outputs profile details to terminal or files as needed.
- DP download → Local files: write files · Saves downloaded display-picture media locally.
- Stories download → Local files: write files · Saves downloaded story media locally.
- Posts download → Local files: write files · Saves downloaded post media locally.
- Build helper → Requirements: install deps · Setup helper prepares the Python environment.
- Requirements → Instaloader: depends on · Dependency manifest includes the core integration library.
- README → Build helper: setup guide · Documentation points to the build/setup step.
- README → InstAstra CLI: run guide · Documentation explains how to start the CLI.