{"id":25164478,"url":"https://github.com/vizonex/aiomultithreading","last_synced_at":"2025-04-30T17:42:51.229Z","repository":{"id":253808998,"uuid":"844595015","full_name":"Vizonex/aiomultithreading","owner":"Vizonex","description":"a concept for multiprocessing and threading and asyncio combined into one executor","archived":false,"fork":false,"pushed_at":"2024-09-03T03:36:58.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T18:23:15.538Z","etag":null,"topics":["asyncio","multiprocessing","multithreading","python","python-asyncio","threading"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/aiomultithreading","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vizonex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-19T15:20:22.000Z","updated_at":"2024-09-03T08:51:45.000Z","dependencies_parsed_at":"2024-08-25T03:28:24.202Z","dependency_job_id":null,"html_url":"https://github.com/Vizonex/aiomultithreading","commit_stats":null,"previous_names":["vizonex/aiomultithreading"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizonex%2Faiomultithreading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizonex%2Faiomultithreading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizonex%2Faiomultithreading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizonex%2Faiomultithreading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vizonex","download_url":"https://codeload.github.com/Vizonex/aiomultithreading/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251753096,"owners_count":21638229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncio","multiprocessing","multithreading","python","python-asyncio","threading"],"created_at":"2025-02-09T04:32:22.080Z","updated_at":"2025-04-30T17:42:51.199Z","avatar_url":"https://github.com/Vizonex.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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\u0026logoColor=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\u0026labelColor=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 with a 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 as\r\nyou may either create unessesary threads or deadlock your program. use [hashcat](https://github.com/hashcat/hashcat) if your goal\r\ninvolves grinding hahes or performing any offline brute-forcing.\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvizonex%2Faiomultithreading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvizonex%2Faiomultithreading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvizonex%2Faiomultithreading/lists"}