Skip to main content

Parallel Requests

Parallel Requests is a Python project that allows you to execute HTTP requests in parallel using the asyncio and aiohttp libraries. This tool is designed to improve efficiency and reduce waiting time when making multiple HTTP requests. With Parallel Requests, you can send GET, POST, PUT, and DELETE requests simultaneously, collecting responses asynchronously and easily managing the results.

**Features**:

- Parallel execution of HTTP requests: Send multiple requests simultaneously to reduce waiting times.

- Support for common HTTP methods: Perform GET, POST, PUT, and DELETE requests.

- Asynchronous management: Utilizes asyncio and aiohttp for efficient request handling.

- Execution time calculation: Measures the time taken to execute each request.

- Ease of use: Simple interface for adding and managing requests.

GitHub Source

You can find source files in:

https://github.com/danelsan/parallel-requests

Installation

For installation by gih write

make install

Puoi installare Parallel Requests usando il file setup.py. Nella directory principale del progetto, esegui il seguente comando:

pip install parallel_reqs

Example

from parallel_reqs import RequestExecutor 
from parallel_reqs import Request

# Lista di URL di esempio
urls = [
    "https://www.google.com",
    "https://www.bing.com",
    "https://www.yahoo.com",
    "https://www.wikipedia.org",
    "https://www.imdb.com",
    "https://www.amazon.com",
    "https://www.ebay.com",
    "https://www.facebook.com",
    "https://www.twitter.com",
    "https://www.instagram.com",
    "https://www.corriere.it",
    "https://www.repubblica.it",
    "https://www.ansa.it",
    "https://www.rainews.it",
    "https://www.sky.it",
    "https://www.msn.com",
    "https://www.aol.com",
    "https://www.cnn.com",
    "https://www.foxnews.com",
    "https://www.bbc.com",
    "https://www.aljazeera.com",
    "https://www.nbcnews.com",
    "https://www.cbsnews.com",
    "https://www.abcnews.go.com",
    "https://www.npr.org",
    "https://www.pbs.org",
    "https://www.huffpost.com",
    "https://www.buzzfeed.com",
    "https://www.vox.com",
    "https://www.slate.com",
    "https://www.theverge.com",
    "https://www.wired.com",
    "https://www.arstechnica.com",
    "https://www.engadget.com",
    "https://www.cnet.com",
    "https://www.zdnet.com",
    "https://www.techcrunch.com",
    "https://www.theatlantic.com",
    "https://www.newyorker.com",
    "https://www.harpersbazaar.com",
    "https://www.vanityfair.com",
    "https://www.gq.com",
    "https://www.esquire.com",
    "https://www.menshealth.com",
    "https://www.womenshealthmag.com",
    "https://www.shape.com",
    "https://www.self.com",
    "https://www.cosmopolitan.com",
    "https://www.glamour.com",
    "https://www.allure.com",
    "https://www.vogue.com",
    "https://www.elle.com",
    "https://www.harpersbazaar.com",
    "https://www.marieclaire.com"
]

                                                                                   
def main():
        print("Urls: ", len(urls))
        executor = RequestExecutor()       
        try:
            for u in urls:
                executor.add_request(Request.create(url=u, method="GET"))
        except Exception as e:    
            print(e)

        responses = executor.run()
        print("Responses: ", len(responses))
        for response in responses: 
            print(f"Status Code: {response.status_code}, Execution Time: {response.execution_time} sec") 

        print( "Total: exec" , executor.execution_time)


main()

Release files for parallel-reqs 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parallel-reqs 0.0.5
File Size Uploaded
parallel_reqs-0.0.5.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for parallel-reqs 0.0.5
File Interpreter ABI Platform
parallel_reqs-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / parallel_reqs-0.0.5.tar.gz

Download URL parallel_reqs-0.0.5.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
765946da07d6329915c92c3040a1b88ebf4638b527723a416bff3b8c7001848f
BLAKE2b-256 checksum
How to use checksums
7c5bceea2da81e962b2566423476966d5fd450e3ecf43a54bf6ae5c43a162fc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.2

Release files / parallel_reqs-0.0.5-py3-none-any.whl

Download URL parallel_reqs-0.0.5-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07b29e83bb2c82338b62cfb1e7c105343e899f6ff430b2107141d4700a9bbb98
BLAKE2b-256 checksum
How to use checksums
0e6aad367441afe0571d3d7278c00a044ac2538f42c880bb22463dc0ca2f6dc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page