aiomultithreading


Nameaiomultithreading JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryAsyncIO, threading and multiprocessing combined to created a powerful executor
upload_time2024-08-23 16:46:07
maintainerNone
docs_urlNone
authorVizonex
requires_python>=3.7
licenseThe MIT License (MIT) Copyright (c) 2024 aiomultithreading-authors, Vizonex Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords aiomultithreading multiprocessing threading asyncio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aiomultithreading:
[![PyPI version](https://badge.fury.io/py/aiomultithreading.svg)](https://badge.fury.io/py/aiomultithreading)
![PyPI - Downloads](https://img.shields.io/pypi/dm/aiomultithreading)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Tests](/aiomultithreading/actions/workflows/tests.yml/badge.svg)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

## What is it?

**aiomultithreading** is

A concept for creating the Best Possible Utilization of threading, multiprocessing and asyncio combined into one
executor allowing the number of tasks running in parallel to be multiplied rapidly without 
having to do very many setups. 

Aiomultithreading is meant for handling super bulky tasks such as proxy-enumeration or networking
on a very large scale. This can be costly for some uneducated programmers but luckily 
this tool completely changes that by making use of not just your threads, cores or
task counts alone, No, All of them combined. This library completely changes the playing-field 
and I expect to see a few people using this for something really intense. 


With the combined help of aiomultiprocessing and aiothreading it is possible to acheieve the 
maximum amount of tasks that can be quickly ran in parallel. 

Even the default tasks per child with threading and cores will surprise you.

Even with the use of a low cpu machine when doing the math (2 processes * 4 threads * 16 tasks per thread) 
it makes a total of 128 tasks. Theses numbers can rapidly multiply when being used pc or device using a higher 
cpu count. 

This library also has compatability for winloop and uvloop right out of the box.


## FYI
- If your goals involved some form of brute-forcing that's offline, please note that Asyncio is not the best canidate for this.
Use hashcat if your trying to grind those kinds of things out.


# Usage:

## Dependencies

## Installing

The easiest way is to install **aiomultithreading** is from PyPI using pip:

```sh
pip install aiomultithreading
```


## Running

First, import the library.

```python
from aiomultithreading import MultiPool
import asyncio 

async def sleep(i:float):
    await asyncio.sleep(i)
    return f"slept for {i}"

async def main():
    # 2 processes and 6 threads...
    async with MultiPool(2, 6) as pool:
        # You can go extremely fast with even 500 of these stacked together...
        x = [i for i in range(5)] * 100
        print(x)
        async for text in pool.map(sleep, x):
            print(text)

if __name__ == "__main__":
    asyncio.run(main())
```


# TODO:
    - Optimize some more important parts

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aiomultithreading",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "aiomultithreading, multiprocessing, threading, asyncio",
    "author": "Vizonex",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# aiomultithreading:\r\n[![PyPI version](https://badge.fury.io/py/aiomultithreading.svg)](https://badge.fury.io/py/aiomultithreading)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dm/aiomultithreading)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n![Tests](/aiomultithreading/actions/workflows/tests.yml/badge.svg)\r\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\r\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\r\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\r\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\r\n\r\n## What is it?\r\n\r\n**aiomultithreading** is\r\n\r\nA concept for creating the Best Possible Utilization of threading, multiprocessing and asyncio combined into one\r\nexecutor allowing the number of tasks running in parallel to be multiplied rapidly without \r\nhaving to do very many setups. \r\n\r\nAiomultithreading is meant for handling super bulky tasks such as proxy-enumeration or networking\r\non a very large scale. This can be costly for some uneducated programmers but luckily \r\nthis tool completely changes that by making use of not just your threads, cores or\r\ntask counts alone, No, All of them combined. This library completely changes the playing-field \r\nand I expect to see a few people using this for something really intense. \r\n\r\n\r\nWith the combined help of aiomultiprocessing and aiothreading it is possible to acheieve the \r\nmaximum amount of tasks that can be quickly ran in parallel. \r\n\r\nEven the default tasks per child with threading and cores will surprise you.\r\n\r\nEven with the use of a low cpu machine when doing the math (2 processes * 4 threads * 16 tasks per thread) \r\nit makes a total of 128 tasks. Theses numbers can rapidly multiply when being used pc or device using a higher \r\ncpu count. \r\n\r\nThis library also has compatability for winloop and uvloop right out of the box.\r\n\r\n\r\n## FYI\r\n- If your goals involved some form of brute-forcing that's offline, please note that Asyncio is not the best canidate for this.\r\nUse hashcat if your trying to grind those kinds of things out.\r\n\r\n\r\n# Usage:\r\n\r\n## Dependencies\r\n\r\n## Installing\r\n\r\nThe easiest way is to install **aiomultithreading** is from PyPI using pip:\r\n\r\n```sh\r\npip install aiomultithreading\r\n```\r\n\r\n\r\n## Running\r\n\r\nFirst, import the library.\r\n\r\n```python\r\nfrom aiomultithreading import MultiPool\r\nimport asyncio \r\n\r\nasync def sleep(i:float):\r\n    await asyncio.sleep(i)\r\n    return f\"slept for {i}\"\r\n\r\nasync def main():\r\n    # 2 processes and 6 threads...\r\n    async with MultiPool(2, 6) as pool:\r\n        # You can go extremely fast with even 500 of these stacked together...\r\n        x = [i for i in range(5)] * 100\r\n        print(x)\r\n        async for text in pool.map(sleep, x):\r\n            print(text)\r\n\r\nif __name__ == \"__main__\":\r\n    asyncio.run(main())\r\n```\r\n\r\n\r\n# TODO:\r\n    - Optimize some more important parts\r\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2024 aiomultithreading-authors, Vizonex  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "AsyncIO, threading and multiprocessing combined to created a powerful executor",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [
        "aiomultithreading",
        " multiprocessing",
        " threading",
        " asyncio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dd1da38475284489af70f8ec15363bd72abba624aa193df8a2c417d1ffbba4fc",
                "md5": "c69da04d5d6a41dbea0d5aaf0ec76212",
                "sha256": "f8b40b228ecad0763500a2b25c3f01b69ebf479592592a13702cfc0e3743779d"
            },
            "downloads": -1,
            "filename": "aiomultithreading-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c69da04d5d6a41dbea0d5aaf0ec76212",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10682,
            "upload_time": "2024-08-23T16:46:07",
            "upload_time_iso_8601": "2024-08-23T16:46:07.540667Z",
            "url": "https://files.pythonhosted.org/packages/dd/1d/a38475284489af70f8ec15363bd72abba624aa193df8a2c417d1ffbba4fc/aiomultithreading-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-23 16:46:07",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "aiomultithreading"
}
        
Elapsed time: 0.76123s