Skip to content
demobdevPublic

About

Automatically unfollow Instagram accounts that don't follow you back, with intelligent rate limit detection.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏠 IG Prune

Digital Decluttering: Your Instagram Life Cleanup

Python 3.8+ License: MIT Code style: black Tests Success Rate Life Improvement

The final phase of your life decluttering journey. Clean up your Instagram following list and focus on what truly matters.

πŸš€ Quick Start β€’ πŸ“– Documentation β€’ 🎯 Features β€’ 🀝 Contributing


✨ Your Digital Decluttering Journey

You've organized your home, your schedule, your mind... Now it's time to declutter your digital life.

IG Prune is your intelligent companion for this final phase:

  • 🏠 Life improvement focused - Part of your broader decluttering journey
  • 🧠 Intelligent automation - Learns from patterns to avoid issues
  • 🎯 Smart prioritization - Removes inappropriate content first
  • πŸ›‘οΈ Foolproof system - Circular logic guides you through every step
  • ⚑ Human-like behavior - Natural delays that respect Instagram's limits
  • πŸ“Š Progress tracking - See your digital life improve over time
  • πŸ”„ Dual methods - Manual export (100% reliable) + automated fallback
  • πŸŽ‰ Life transformation - Focus on accounts that truly inspire you

🎯 Features

🧠 Intelligent Rate Limit Detection

  • Automatic detection of Instagram rate limits
  • Pattern learning from previous rate limit events
  • Risk assessment before each run
  • Adaptive batch sizing based on risk level

🏷️ Smart Account Classification

  • T1 (Keep): Professional/interest accounts (photography, tech, space)
  • T2 (Influencer): General influencers and brands
  • T3 (Default): Regular accounts that don't follow back
  • T4 (Adult Content): Adult/NSFW content (highest priority removal)

πŸ›‘οΈ Safety & Reliability

  • Human-like delays: 5-15 seconds between unfollows
  • Batch limiting: Maximum 30 accounts per run
  • Error handling: Robust error recovery and logging
  • Progress tracking: Automatic CSV file updates

πŸš€ Quick Start

πŸ›‘οΈ Foolproof Method (Recommended) βœ…

The system guides you through every step with circular logic:

# 1. Clone and setup
git clone https://github.com/demobdev/ig-prune.git
cd ig-prune
python3 setup.py
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# 2. Run the foolproof guide
python3 foolproof_guide.py

The guide will:

  • βœ… Check your setup automatically
  • βœ… Guide you through Instagram data export
  • βœ… Handle any issues that come up
  • βœ… Walk you through each step
  • βœ… Ensure you succeed in your digital decluttering

Method 1: Instagram Data Export (Manual) βœ…

This method works 100% of the time and avoids rate limits:

# 1. Clone and setup
git clone https://github.com/demobdev/ig-prune.git
cd ig-prune
python3 setup.py
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# 2. Export your Instagram data
# Go to Instagram β†’ Settings β†’ Privacy β†’ Data Download
# Request your data (takes 24-48 hours)
# Download and extract followers_1.json and following.json
# Place them in the project root

# 3. Process and automate
python3 ig_prune.py export
python3 ig_prune.py classify
python3 ig_prune.py batch
python3 ig_prune.py unfollow YOUR_USERNAME 'YOUR_PASSWORD'

Method 2: Automated Export (Fallback) ⚠️

Use this if you want to try automated export (may hit rate limits):

# 1. Setup (same as above)
git clone https://github.com/demobdev/ig-prune.git
cd ig-prune
python3 setup.py
source .venv/bin/activate

# 2. Try automated export (may fail due to rate limits)
python3 -m src.export_lists YOUR_USERNAME

# 3. If automated fails, use Method 1 (Instagram data export)
# 4. Continue with classification and automation
python3 ig_prune.py classify
python3 ig_prune.py batch
python3 ig_prune.py unfollow YOUR_USERNAME 'YOUR_PASSWORD'

Option 2: Manual Setup

git clone https://github.com/demobdev/ig-prune.git
cd ig-prune
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Follow the same process as Option 1

🌟 Life Improvement Results

Your Digital Decluttering Success:

🏠 DIGITAL DECLUTTERING: Your Instagram Life Cleanup
==================================================
✨ Welcome to the final phase of your life decluttering journey!

πŸ” STEP 1: Checking your setup...
βœ… Python version: 3.9.7
βœ… Virtual environment: Active
βœ… Dependencies: Installed

πŸ“€ STEP 2: Getting your Instagram data...
βœ… Instagram data files found!

🏷️  STEP 3: Classifying your accounts...
βœ… Classification complete!
   T1 (Keep): 168 professional/interest accounts
   T2 (Influencer): 226 general influencers/brands
   T3 (Default): 4,758 regular accounts
   T4 (Adult Content): 93 inappropriate accounts

πŸ“‹ STEP 4: Generating your daily cleanup batch...
βœ… Daily batch generated! (30 accounts prioritized)

πŸ€– STEP 5: Running your digital decluttering...
βœ… Successfully unfollowed: 30/30 (100% success rate)
❌ Failed to unfollow: 0
🚨 Rate limits encountered: 0

πŸŽ‰ DIGITAL DECLUTTERING COMPLETE!
✨ Congratulations! You've successfully:
   βœ… Cleaned up your Instagram following list
   βœ… Removed accounts that don't serve you
   βœ… Created space for meaningful connections
   βœ… Improved your digital well-being

Real Impact on Your Life:

  • 🧠 Mental clarity - Less digital noise in your feed
  • ⏰ Time saved - No more scrolling through irrelevant content
  • 🎯 Focus improved - Only see what truly inspires you
  • 😌 Stress reduced - No more comparison with inappropriate content
  • 🌱 Growth mindset - Surround yourself with positive influences

πŸ“€ Data Export Methods

Method 1: Instagram Data Export (Recommended) βœ…

Why this method is better:

  • βœ… 100% reliable - Works every time
  • βœ… No rate limits - Uses Instagram's official system
  • βœ… Complete data - Gets all followers/following
  • βœ… Privacy safe - No login credentials needed for export

How to do it:

  1. Go to Instagram β†’ Settings β†’ Privacy β†’ Data Download
  2. Request your data (takes 24-48 hours)
  3. Download the ZIP file when ready
  4. Extract followers_1.json and following.json
  5. Place them in the project root
  6. Run python3 ig_prune.py export

Method 2: Automated Export (Fallback) ⚠️

When to use this:

  • ⚠️ May hit rate limits - Instagram blocks automated access
  • ⚠️ Requires login - Need to provide credentials
  • ⚠️ Less reliable - May fail due to Instagram's restrictions

How to do it:

  1. Run python3 -m src.export_lists YOUR_USERNAME
  2. If it fails due to rate limits, use Method 1 instead

πŸ–₯️ CLI Commands

# 🏠 Digital decluttering (recommended)
python3 ig_prune.py foolproof                # Start your digital decluttering journey

# Setup and configuration
python3 ig_prune.py setup                    # Initial setup
python3 ig_prune.py status                   # Check rate limit status

# Data processing
python3 ig_prune.py export                   # Process Instagram data export
python3 ig_prune.py classify                 # Classify accounts into tiers
python3 ig_prune.py batch                    # Generate daily unfollow batch

# Automation
python3 ig_prune.py unfollow user pass       # Run automated unfollow

πŸ“ Project Structure

ig-prune/
β”œβ”€β”€ src/                          # Core modules
β”‚   β”œβ”€β”€ manual_export.py         # Process Instagram data export
β”‚   β”œβ”€β”€ classify_nonfollowers.py # Classify accounts into tiers
β”‚   β”œβ”€β”€ daily_pick.py            # Generate daily unfollow batch
β”‚   β”œβ”€β”€ utils.py                 # Classification logic
β”‚   └── schemas.py               # Data schemas
β”œβ”€β”€ auto_unfollow.py             # Main automation script
β”œβ”€β”€ rate_limit_monitor.py        # Rate limit detection & learning
β”œβ”€β”€ ig_prune.py                  # CLI interface
β”œβ”€β”€ setup.py                     # Automated setup
β”œβ”€β”€ config_example.py            # Configuration template
└── requirements.txt             # Dependencies

πŸ”§ Configuration

Customize your experience by editing the configuration:

# auto_unfollow.py
BATCH_SIZE = 30              # Accounts per run
DELAY_MIN = 5                # Min delay between unfollows (seconds)
DELAY_MAX = 15               # Max delay between unfollows (seconds)

# Classification keywords (customize for your interests)
PROFESSIONAL_KEYWORDS = [
    "camera", "photo", "photography", "astro", "space", 
    "tech", "science", "engineering", "design"
]

πŸ“ˆ Rate Limit Intelligence

IG Prune learns from your Instagram interactions:

# Check your rate limit status
python3 ig_prune.py status

# Example output:
πŸ” Rate Limit Risk: LOW
πŸ“ Reason: Last rate limit was 2 days ago

πŸ“Š Rate Limit Pattern Analysis:
========================================
πŸ”΄ Worst day: Friday (3 rate limits)
πŸ”΄ Worst hour: 14:00 (2 rate limits)

πŸ’‘ Recommendations:
   - Avoid heavy usage on Fridays
   - Avoid heavy usage around 14:00
   - Average 24.5 hours between rate limits

⚠️ Important Notes

  • Use responsibly - Don't exceed 30-50 unfollows per day
  • Monitor for blocks - Instagram may detect automation
  • Start small - Test with 5-10 accounts first
  • Respect rate limits - The system will warn you of risks
  • Backup data - Keep your CSV files safe

πŸ› οΈ Troubleshooting

Common Issues

"Rate limit exceeded" during export

# This is why we recommend Method 1 (Instagram data export)
# If you hit rate limits, use Instagram's official data export instead:
# 1. Go to Instagram β†’ Settings β†’ Privacy β†’ Data Download
# 2. Request your data (24-48 hours)
# 3. Use the downloaded JSON files

"bad_password" Error

# Check credentials and 2FA settings
python3 ig_prune.py status

Rate Limiting during unfollow

# Check rate limit patterns
python3 ig_prune.py status
# Wait longer between runs or reduce batch size

No Data Files

# Ensure you've exported Instagram data
python3 ig_prune.py export

"No followers/following data found"

# Make sure you have the correct JSON files:
# - followers_1.json (from Instagram data export)
# - following.json (from Instagram data export)
# Place them in the project root directory

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

git clone https://github.com/demobdev/ig-prune.git
cd ig-prune
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt  # For development

Running Tests

python3 -m pytest tests/

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

⚠️ Important Legal Disclaimer

EDUCATIONAL PURPOSE ONLY: This software is provided for educational and research purposes only. Users are responsible for complying with all applicable laws and terms of service.

NO WARRANTY: The authors make no representations or warranties regarding the legality of using this software with Instagram or any other service.

USER RESPONSIBILITY: Users assume full responsibility for their use of this software and any consequences that may arise from such use.

THIRD-PARTY SERVICES: This software interacts with third-party services (Instagram) and users must comply with those services' terms of service.

ACCOUNT RISKS: Use of this software may result in account restrictions, suspensions, or bans. Users assume all risks associated with such outcomes.

NO LIABILITY: The authors shall not be liable for any damages, losses, or legal issues arising from the use of this software.

USE AT YOUR OWN RISK: Instagram's Terms of Service may prohibit automated actions. Users are solely responsible for ensuring compliance with all applicable terms of service and laws.


About

Automatically unfollow Instagram accounts that don't follow you back, with intelligent rate limit detection.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages