A Python-based Instagram automation tool
Project description
InstaFlow
A powerful, feature-rich Instagram automation library for Python.
Overview
InstaFlow is a robust Instagram automation tool designed to help Instagram users grow their accounts organically through smart, configurable automation processes. It provides a complete set of tools for account management, engagement, and growth while focusing on safety and mimicking human behavior to avoid detection.
Features
- Account Management: Secure cookie-based authentication with encryption
- User Interaction: Follow, unfollow, and engage with users based on various targeting criteria
- Content Engagement: Like, comment, and view stories with configurable rate limits
- Hashtag & Location Targeting: Find and engage with users based on hashtags and locations
- Follower Management: Track followers/following, unfollow non-followers, and maintain whitelists
- Safety First: Built-in rate limits and human-like behavior patterns
- CLI Interface: Complete command-line interface for easy automation
- Customizable: Extensive configuration options for all aspects of automation
- Well-Documented: Comprehensive documentation with examples
Installation
# Install from PyPI
pip install instaflow
# Development installation
git clone https://github.com/BimaPangestu28/InstaFlow.git
cd InstaFlow
pip install -e .
Quick Start
Basic Usage
from instaflow import InstagramBot
# Initialize with environment variables INSTAGRAM_USERNAME and INSTAGRAM_PASSWORD
bot = InstagramBot()
# Login to Instagram
if bot.login():
# Follow a user
bot.follow_user('target_username')
# Like a post
bot.like_post('https://www.instagram.com/p/ABC123/')
# Explore a hashtag and get recent posts
posts = bot.explore_hashtag('photography')
# Remember to close the browser when done
bot.close()
Using the CLI
# Run daily engagement routine
instaflow daily --hashtags "photography,nature,travel" --follow 20 --unfollow 15
# Follow users based on a hashtag
instaflow follow photography --count 10 --like
# Engage with existing followers
instaflow engage --count 15 --likes 3 --comment
# Unfollow users who don't follow back
instaflow unfollow --count 20 --days 7 --whitelist "friend1,friend2"
Configuration
InstaFlow can be configured through:
- Default configuration file:
config/default.json - Custom configuration file: Specified with
--configoption - Environment variables: Override settings from config files
Example .env file:
INSTAGRAM_USERNAME=your_username
INSTAGRAM_PASSWORD=your_password
COOKIE_ENCRYPTION_KEY=your_secure_key
# Optional overrides
CONFIG_HEADLESS=true
CONFIG_LOG_LEVEL=INFO
Advanced Features
Running a Complete Growth Campaign
from instaflow.bot import run_daily_engagement_routine
with InstagramBot() as bot:
if bot.login():
# Run a complete daily routine with balanced actions
results = run_daily_engagement_routine(
bot,
hashtags=['photography', 'travel', 'nature'],
follow_count=20,
unfollow_count=15,
like_count=50
)
print(f"Campaign results: {results}")
Custom Comment Templates
from instaflow.bot import follow_users_by_hashtag
with InstagramBot() as bot:
if bot.login():
results = follow_users_by_hashtag(
bot,
'photography',
count=10,
like_posts=True,
comment=True,
comment_templates=[
"Great shot! {emoji}",
"Love the {adjective} composition {emoji}",
"The lighting is {adjective}! {emoji}"
]
)
Safety and Best Practices
- Start with low limits and gradually increase them
- Use realistic delays between actions (already built into InstaFlow)
- Avoid running automation 24/7
- Don't use multiple automation tools at the same time
- Rotate between different actions to appear natural
- Always respect Instagram's terms of service
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/BimaPangestu28/InstaFlow.git
cd InstaFlow
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -r requirements-dev.txt
# Install the package in development mode
pip install -e .
Running Tests
# Run all tests
pytest
# Run with coverage report
pytest --cov=src tests/
License
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer
This tool is for educational purposes only. Automation of Instagram actions may violate Instagram's terms of service. Use at your own risk.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Contact
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file instaflow-0.1.0.tar.gz.
File metadata
- Download URL: instaflow-0.1.0.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bb0b697bc51345ab5ff755eb91bd758f636294498ca31f398166012001d9d7e
|
|
| MD5 |
5090f5dbd8cb6cdd5dc1f0a53ae36c86
|
|
| BLAKE2b-256 |
7f5eab67a713cd49223e16e4cd1e76e7a52945d94eb0c77153d2a8e3c9ebafad
|
File details
Details for the file instaflow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: instaflow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d0b0c200c1594396b68a2b55ee63e62cd2fa5718e252fee6ca843821fdaa361
|
|
| MD5 |
ea82bc7935bb47f9ba950e4379f06b2e
|
|
| BLAKE2b-256 |
5f23d1585de0fe8f1c23c628dfa8c08d79b11906aebc868766752e240bd13487
|