Skip to content

peppapig450/insta-message-analyzer

Repository files navigation

Instagram Message Analyzer

CI PyPI version PyPI - Python Version

Instagram Message Analyzer is a Python toolkit for exploring your archived Instagram conversations. It loads message exports from Meta, processes them into structured data, and runs several analysis strategies to reveal messaging patterns and network relationships. Optional visualizations are produced using Plotly.

Features

  • Data loading and preprocessing – Converts Meta JSON exports into a single DataFrame with normalized sender names, timestamps and reactions.
  • Activity analysis – Computes time‑series metrics, burst detection, top senders and chat lifecycle statistics.
  • Network analysis – Builds a bipartite graph of senders and chats to measure centrality, communities, influence and reactions.
  • Visualization – Generates interactive HTML plots for message frequency, active hours, top senders and more.
  • Pipeline orchestration – Modular AnalysisPipeline class runs multiple strategies and saves results to disk.
  • Command‑line interfaceinsta-analyze entry point for quick analysis of a folder containing exported messages.

Installation

Install from PyPi:

pip install insta-message-analyzer

Python 3.12 or 3.13 is required. The project uses Poetry for dependency management.

poetry install --with dev

To install from source without the development tools, run poetry install without the --with dev flag. You may also install the package with pip:

pip install .

Usage

  1. Export your Instagram data from Meta and extract the archive so that your message JSON files reside under data/your_instagram_activity/messages.
  2. Run the analysis pipeline:
poetry run insta-analyze

Results are written to the output directory. Logs are stored in output/logs/insta_analyzer.log.

You can also run the main module directly:

python -m insta_message_analyzer.main

Running Tests

The repository contains a test suite for the network analysis component. Execute it with pytest:

poetry run pytest

Linting and type checking are performed via Ruff and MyPy. A pre‑commit configuration is provided and can be enabled with:

pre-commit install

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub. Before submitting code, run the pre‑commit hooks and ensure all tests pass.

License

This project is licensed under the MIT License. See LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages