How chrisj1259/followersreport works
Purpose and entry points
Instagram Follower Report is a local-first Python application that analyzes timestamped Instagram export snapshots. It reports follower/following relationships, historical unilateral unfollows, and manually or network-detected disabled accounts. It has two delivery modes:
• CLI/local HTTP server: run.py
• Windows native window wrapping the same local app: app.py
Core UI is a browser/WebView-rendered single page in index.html.
Analysis and report pipeline
run.py is the primary backend and command dispatcher. It imports export files, reads snapshots, computes follower/following set differences and historical comparisons, writes the active report cache, and serves the UI on loopback only.
• run.py
• index.html
Snapshot input is Instagram JSON (followers_1.json, following.json) staged under dated data directories. The pipeline retains dates so it can distinguish current non-mutual relationships from accounts that previously followed but later unfollowed.
Local storage and profile boundary
Source/CLI mode uses repository-local data/, dist/, and ig-session/. Installed mode relocates mutable state to %APPDATA%\InstagramFollowerReport\, keeping packaged program files read-only.
Desktop accounts are isolated profiles: snapshots, disabled-account flags, and report state are associated with an internal profile ID rather than the visible Instagram username. Migration supports moving legacy single-account data into a selected profile.
• run.py
• app.py
UI and local API boundary
The frontend is a self-contained HTML/CSS/JavaScript application. It displays stat cards and relationship panels, supports drag/drop or file-based snapshot import, profile selection, and flag/unflag actions. It communicates only with the local Python server/application state; no hosted web backend is involved.
• index.html
• run.py
Instagram status and live-count integration
Optional Instagram integration is isolated in ig_helper.py. It uses Scrapling with Chrome for an explicit visible login, persists a local browser session, then performs authenticated profile checks for live counts and flagged-account rechecks. Ambiguous failures preserve flags. A separate CLI mode can perform anonymous checks for deleted/deactivated pages.
• ig_helper.py
• run.py
The required runtime is Python 3.10+. Chrome and scrapling[fetchers] are optional except for login, live counts, and authenticated status rechecks.
Windows desktop packaging
app.py launches the local application inside pywebview for the Windows desktop experience. Packaging builds a PyInstaller executable, then produces an Inno Setup installer that installs or bootstraps Microsoft Edge WebView2 and creates Windows shortcuts/uninstall metadata.
• app.py
• build.py
• build.spec
• installer.iss
Release/update infrastructure
The installed application checks public GitHub Releases for newer versions and can download/run the newer installer, while preserving %APPDATA% data. GitHub Actions builds/tests normal changes and builds tagged releases for distribution.
• .github/workflows/build.yml
• app.py
• build.py
Main entry points: run.py CLI and loopback server · build.py Executable build · ig_helper.py Instagram status helper · app.py Release updater
Components 17
Local Analysis App
- CLI and loopback server · Imports snapshots, generates reports, and serves the local UI.
run.py - Relationship analysis · Compares dated follower and following snapshots for current and historical changes.
run.py - Local UI API · Exposes local application state and actions without a hosted backend.
run.py - Single-page UI · Imports snapshots, displays reports, manages profiles, and flags accounts.
index.html
Local State
- Instagram JSON snapshots · Dated followers_1.json and following.json exports retain relationship history.
- Snapshots and report cache · Uses repository-local data/ in source mode and AppData in installed mode.
- Internal profile state · Separates snapshots, flags, and report state by internal profile ID.
- Legacy data migration · Moves prior single-account data into a selected profile.
app.py
Optional Instagram Integration
- Instagram status helper · Performs visible login, live-count checks, and flagged-account rechecks.
ig_helper.py - Chrome session · Scrapling/Chrome session persisted locally for authenticated checks.
- Anonymous status checks · Checks deleted or deactivated profile pages without login.
run.py
Windows Distribution
- Windows WebView shell · Hosts the same local application in a native Windows window.
app.py - Release updater · Downloads and runs a newer installer while preserving AppData state.
app.py
Build and Release
- Executable build
build.py - PyInstaller spec
build.spec - Windows installer · Installs the executable, WebView2 support, shortcuts, and uninstall metadata.
installer.iss - CI and tagged releases · Builds/tests changes and publishes distributable tagged releases.
.github/workflows/build.yml
Connections 19
- Instagram JSON snapshots → CLI and loopback server: import
- CLI and loopback server → Relationship analysis: analyze
- Relationship analysis → Snapshots and report cache: write active report
- CLI and loopback server → Local UI API: serve
- Single-page UI → Local UI API: local actions and reports
- Local UI API → Internal profile state: read/update profile state
- Relationship analysis → Internal profile state: associate report with profile
- Legacy data migration → Internal profile state: migrate selected account
- Windows WebView shell → CLI and loopback server: launch same local app
- CLI and loopback server → Instagram status helper: request authenticated checks
- Instagram status helper → Chrome session: persist login
- Anonymous status checks → Instagram status helper: alternate status mode
- Instagram status helper → Internal profile state: update disabled-account flags
- Executable build → PyInstaller spec: use spec
- Executable build → Windows WebView shell: package
- Executable build → Windows installer: stage executable
- CI and tagged releases → Executable build: build/test/release
- Release updater → Windows installer: download and run update
- Release updater → Snapshots and report cache: preserve AppData