Skip to main content

Open Source Proxy Rotation Solution ✨

Project description

NeuroNexus

Open Source Proxy Rotation Solution 🌐

Freely Scrape, and Crawl Fast and Easy ✨

Contributors Forks Stargazers Issues Closed Issues MIT License

🔧 Installation

pip install NeuroNexus

🛠 Setup

Make an AWS account and create a new IAM user with the permission of AmazonAPIGatewayAdministrator. Then, to find your access key ID and secret access key, follow the official AWS tutorial.

Set up your AWS credentials in your .env file or with awscli by running aws configure.

PROXY_POOL_AWS_ACCESS_KEY_ID=your_access_key_id
PROXY_POOL_AWS_SECRET_ACCESS_KEY=your_secret_access_key

📖 Usage

Example usage:

import os
import asyncio
from dotenv import load_dotenv
from neuronexus import IPProxyPool

load_dotenv()

AWS_ACCESS_KEY_ID = os.getenv("PROXY_POOL_AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = os.getenv("PROXY_POOL_AWS_SECRET_ACCESS_KEY")


async def main():
    session = IPProxyPool(
        "https://api.ipify.org",
        key_id=AWS_ACCESS_KEY_ID,
        key_secret=AWS_SECRET_ACCESS_KEY,
        regions=["us-east-1"],
        verbose=True,
    )
    await session.start()
    for _ in range(5):
        response = await session.get("https://api.ipify.org")
        print(f"Your ip: {await response.text()}")
    await session.close()

if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    loop.run_until_complete(main())

Alternate Usage (Automatic Shutdown)

import os
import asyncio
from dotenv import load_dotenv
from neuronexus import IPProxyPool

load_dotenv()

AWS_ACCESS_KEY_ID = os.getenv("PROXY_POOL_AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = os.getenv("PROXY_POOL_AWS_SECRET_ACCESS_KEY")

async def main():
    async with IPProxyPool(
        "https://api.ipify.org",
        key_id=AWS_ACCESS_KEY_ID,
        key_secret=AWS_SECRET_ACCESS_KEY,
        regions=["us-east-1"],
        verbose=True,
    ) as session:
        for _ in range(5):
            response = await session.get("https://api.ipify.org")
            print(f"Your ip: {await response.text()}")


if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    loop.run_until_complete(main())

⚠️ Remember: If gateways are not shut down via the shutdown() method via method #1, you may incur charges.

📌 Output:
>> Starting IP Rotating APIs in 1 regions
>> Created API with id "vg3uqmsxk8"
>> API launched in 1 regions out of 1
Your ip: 242.95.100.230
Your ip: 195.203.105.186
Your ip: 93.48.255.192
Your ip: 132.216.102.184
Your ip: 177.139.104.241
>> Deleted rest API with id "vg3uqmsxk8"
>> All created APIs for ip rotating have been deleted

🔎 Parameters Guide

NeuroNexus supports various parameters that you can include when initializing the API Gateway. Here's a detailed overview of all the parameters available:

 

Name Description Required Default
site The site (without path) requests will be sent to. True
regions An array of AWS regions to setup gateways in. False DEFAULT_REGIONS
key_id AWS Access Key ID (will override env variables). False Relies on env variables.
key_secret AWS Access Key Secret (will override env variables). False Relies on env variables.
verbose Include status and error messages. False False
📌 Example:
from neuronexus import IPProxyPool, EXTRA_REGIONS, ALL_REGIONS

# Gateway to outbound HTTP IP and port for only two regions
gateway_1 = IPProxyPool("http://1.1.1.1:8080", regions=["eu-west-1", "eu-west-2"])

# Gateway to HTTPS google for the extra regions pack, with specified access key pair
gateway_2 = IPProxyPool("https://www.google.com", regions=EXTRA_REGIONS, key_id="ID", key_secret="SECRET")

🤝 Contributing

  1. 🍴 Fork the repo!

  2. 🔧 Make your changes.

  3. 📦 Push your changes to a new branch and create a Pull Request.

Every contribution is welcome! 💖

📄 License

This project is licensed under the MIT License. For more details, see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NeuroNexus-1.0.0.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

NeuroNexus-1.0.0-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page