Skip to content

Releases: RafaelWO/unparallel

0.4.0

02 Jun 12:58
c7d299c
Compare
Choose a tag to compare

What's Changed

This new release of Unparallel comes with a major fix that improves the performance and reduces the number of timeout errors massively if you do thousands of web requests with Unparallel! ⚡
This is achieved by synchronizing the async tasks with a semaphore object having the same value as the maximum connections (benchmarking tests showed that setting the semaphore to a higher value gives worse results; see also #197).


Additionally, you can now initialize (or reuse) your own httpx.AsyncClient and pass it to Unparallel:

client = httpx.AsyncClient(...)
await up(..., client=client)

See also #186 or check the related section in the docs.

🚀 Features

  • Add option to pass a custom HTTPX Client to Unparallel (#186) @RafaelWO

🔧 Fixes & Refactoring

📦 Build System & CI/CD

📝 Documentation

  • Fix Code Blocks in Docs (use pytest-examples for testing) (#146) @RafaelWO

⬆️ Dependencies updates

Update dev dependencies

👥 List of contributors

@RafaelWO and @dependabot


Full Changelog: 0.3.0...0.4.0

0.3.0

04 Mar 07:09
Compare
Choose a tag to compare

What's Changed

This new release of Unparallel comes with two main new features:

  • Support different URLs in one call to up()
  • The new parameter response_fn allows you to configure your custom response function

Support different URLs
The first feature is also a breaking change because the first parameter of up() is no longer the base URL but the list of URLs (or paths if you specify base_url additionally). Before, you could use Unparallel as follows:

async def main():
    url = "https://httpbin.org"
    paths = [f"/get?i={i}" for i in range(5)]
    results = await up(url, paths)

To migrate the code above to work with version 0.3.0 you have to pass the base URL as a keyword argument base_url=url:

async def main():
    url = "https://httpbin.org"
    paths = [f"/get?i={i}" for i in range(5)]
    results = await up(paths, base_url=url)  # <--- CHANGE

Or you use full URLs as the first parameter:

async def main():
    urls = [f"https://httpbin.org/get?i={i}" for i in range(5)]
    results = await up(urls)

Configure a custom response function
You can configure custom response processing using the new parameter response_fn. Per default, the .json() method of the Response object is called. If you e.g. want to return just the status codes, you can pass response_fn=lambda x: x.status_code to up(). You can find more details in the docs.


💥 Breaking Changes

🚀 Features

  • Feature: Support different URLs per request (#108) @RafaelWO
  • Feature: Add parameter to configure custom response function (#109) @RafaelWO

🔧 Fixes & Refactoring

📦 Build System & CI/CD

📝 Documentation

⬆️ Dependencies updates

Click for details

👥 List of contributors

@RafaelWO and @dependabot


Full Changelog: 0.2.0...0.3.0

0.2.0

29 Dec 17:16
a1be7de
Compare
Choose a tag to compare

The second release of Unparallel comes with some new features for configuring your HTTP requests (timeouts, limits, payload). Additionally, the docs are extended with more details on the usage (including examples) - see here.

🚀 Features

  • Feature: Configure HTTPX timeouts and limits (#87) @RafaelWO
  • Feature: Add support for single payload for multiple paths (#101) @RafaelWO

📦 Build System & CI/CD

💥 Breaking Changes

To be in line with HTTPX's options, the parameter connection_limit was renamed to max_connections (same as in HTTPX) in the function up() (see #87).

📝 Documentation

⬆️ Dependencies updates

👥 List of contributors

@RafaelWO, @dependabot and @dependabot[bot]

Full Changelog: 0.1.0...0.2.0

0.1.0

12 May 10:20
eb211ab
Compare
Choose a tag to compare

This is the initial release of unparallel! 🚀

Check out the README for examples and features.

What's Changed

🚀 Features

📦 Build System & CI/CD

📝 Documentation

⬆️ Dependencies updates

Click to expand

👥 List of contributors

@RafaelWO, @dependabot