futurepool


Namefuturepool JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryFuturePool is a package that introduce known concept of multiprocessing Pool to the async/await world, resulting in async workers pool library. It allows for easy translation from multiprocessing to async/await, while keeping the core principle - specified number of workers. FuturePool allows for more flexible usage by providing starimap/starimap_unordered.
upload_time2024-11-10 20:47:24
maintainerNone
docs_urlNone
authorMichal Karol
requires_python<4.0,>=3.10
licenseMIT
keywords async/await worker pool scrappig future future pool async pool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FuturePool [![PyPI - Version](https://img.shields.io/pypi/v/futurepool?style=for-the-badge)](https://pypi.org/project/futurepool/)

FuturePool is a package that introduce known concept of multiprocessing Pool to the async/await world, resulting in async workers pool library. It allows for easy translation from multiprocessing to async/await, while keeping the core principle - specified number of workers. FuturePool allows for more flexible usage by providing starimap/starimap_unordered.

FuturePool was created to handle web scrapping, where in order to not overwhelm website with connections and comply with website requirements, specified number of workers was used. FuturePool was extended to handle generic scenarios and published.

## License
MIT

## Example
To see library docs visit [https://MichalKarol.github.io/futurepool/](https://MichalKarol.github.io/futurepool/).

Example translation from multiprocessing to FuturePool

```python
# multiprocessing
from multiprocessing import Pool
from time import sleep

def pool_fn(i):
    sleep(i)
    return i

with Pool(2) as p:
    result = p.map(pool_fn, range(10))
```

```python
# FuturePool
from futurepool import FuturePool
from asyncio import sleep

async def async_pool_fn(i):
    await sleep(i)
    return i

async with FuturePool(2) as fp:
    result = await fp.map(async_pool_fn, range(10))
```

## Author
MichaƂ Karol <michal.p.karol@gmail.com>  
[Mastodon](https://mastodon.pl/@mkarol)  
[Github](https://github.com/MichalKarol)  

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "futurepool",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "async/await, worker, pool, scrappig, future, future pool, async pool",
    "author": "Michal Karol",
    "author_email": "michal.p.karol@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c6/a8/57d53594498f6999683b47e0d955a7f88222081ba798e097ad0eb370185a/futurepool-1.0.1.tar.gz",
    "platform": null,
    "description": "# FuturePool [![PyPI - Version](https://img.shields.io/pypi/v/futurepool?style=for-the-badge)](https://pypi.org/project/futurepool/)\n\nFuturePool is a package that introduce known concept of multiprocessing Pool to the async/await world, resulting in async workers pool library. It allows for easy translation from multiprocessing to async/await, while keeping the core principle - specified number of workers. FuturePool allows for more flexible usage by providing starimap/starimap_unordered.\n\nFuturePool was created to handle web scrapping, where in order to not overwhelm website with connections and comply with website requirements, specified number of workers was used. FuturePool was extended to handle generic scenarios and published.\n\n## License\nMIT\n\n## Example\nTo see library docs visit [https://MichalKarol.github.io/futurepool/](https://MichalKarol.github.io/futurepool/).\n\nExample translation from multiprocessing to FuturePool\n\n```python\n# multiprocessing\nfrom multiprocessing import Pool\nfrom time import sleep\n\ndef pool_fn(i):\n    sleep(i)\n    return i\n\nwith Pool(2) as p:\n    result = p.map(pool_fn, range(10))\n```\n\n```python\n# FuturePool\nfrom futurepool import FuturePool\nfrom asyncio import sleep\n\nasync def async_pool_fn(i):\n    await sleep(i)\n    return i\n\nasync with FuturePool(2) as fp:\n    result = await fp.map(async_pool_fn, range(10))\n```\n\n## Author\nMicha\u0142 Karol <michal.p.karol@gmail.com>  \n[Mastodon](https://mastodon.pl/@mkarol)  \n[Github](https://github.com/MichalKarol)  \n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "FuturePool is a package that introduce known concept of multiprocessing Pool to the async/await world, resulting in async workers pool library. It allows for easy translation from multiprocessing to async/await, while keeping the core principle - specified number of workers. FuturePool allows for more flexible usage by providing starimap/starimap_unordered.",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://michalkarol.github.io/futurepool/",
        "Homepage": "https://michalkarol.github.io/futurepool/",
        "Issues": "https://github.com/MichalKarol/futurepool/issues",
        "Releases": "https://github.com/MichalKarol/futurepool/releases",
        "Repository": "https://github.com/MichalKarol/futurepool"
    },
    "split_keywords": [
        "async/await",
        " worker",
        " pool",
        " scrappig",
        " future",
        " future pool",
        " async pool"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e33c166f5777faf1ade3ad93b3a569f64e8aea9968bb0cefb23d7fa6031f8b5f",
                "md5": "6856d031f0e786cfc2d02dd4e4f05219",
                "sha256": "7ccf7f489bfec81333a36ecfd22a319f5d48031d4eac42c6d683e5940947f97b"
            },
            "downloads": -1,
            "filename": "futurepool-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6856d031f0e786cfc2d02dd4e4f05219",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 5276,
            "upload_time": "2024-11-10T20:47:22",
            "upload_time_iso_8601": "2024-11-10T20:47:22.586647Z",
            "url": "https://files.pythonhosted.org/packages/e3/3c/166f5777faf1ade3ad93b3a569f64e8aea9968bb0cefb23d7fa6031f8b5f/futurepool-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c6a857d53594498f6999683b47e0d955a7f88222081ba798e097ad0eb370185a",
                "md5": "e402f63e35853763e81bfcefa9dea2ff",
                "sha256": "08aff857e2e11a012cbfbb82db4f26c9f5d71281435720788f889e5eaa7268ba"
            },
            "downloads": -1,
            "filename": "futurepool-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e402f63e35853763e81bfcefa9dea2ff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 4792,
            "upload_time": "2024-11-10T20:47:24",
            "upload_time_iso_8601": "2024-11-10T20:47:24.182692Z",
            "url": "https://files.pythonhosted.org/packages/c6/a8/57d53594498f6999683b47e0d955a7f88222081ba798e097ad0eb370185a/futurepool-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-10 20:47:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MichalKarol",
    "github_project": "futurepool",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "futurepool"
}
        
Elapsed time: 0.38394s