{"id":24639657,"url":"https://github.com/jpleorx/parallelizer","last_synced_at":"2025-03-20T10:48:00.017Z","repository":{"id":57450714,"uuid":"367398727","full_name":"JPLeoRX/parallelizer","owner":"JPLeoRX","description":"Parallel execution of your tasks simplified! Analog to concurrent.futures executors","archived":false,"fork":false,"pushed_at":"2021-05-14T22:48:12.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T07:17:43.292Z","etag":null,"topics":["executor","multiprocessing","multithreading","parallel","pip","process","python","thread"],"latest_commit_sha":null,"homepage":"","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/JPLeoRX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-14T15:06:54.000Z","updated_at":"2021-05-14T22:48:14.000Z","dependencies_parsed_at":"2022-09-26T17:31:33.991Z","dependency_job_id":null,"html_url":"https://github.com/JPLeoRX/parallelizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPLeoRX%2Fparallelizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPLeoRX%2Fparallelizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPLeoRX%2Fparallelizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPLeoRX%2Fparallelizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JPLeoRX","download_url":"https://codeload.github.com/JPLeoRX/parallelizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244600677,"owners_count":20479304,"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":["executor","multiprocessing","multithreading","parallel","pip","process","python","thread"],"created_at":"2025-01-25T11:12:22.024Z","updated_at":"2025-03-20T10:47:59.970Z","avatar_url":"https://github.com/JPLeoRX.png","language":"Python","readme":"# parallelizer\nParallel execution of your tasks simplified! This package can be used as an alternative to Python's `concurrent.futures` executors, or as an analog of Java's `ExecutorService`.\n\nTwo simple wrappers (thread-based and process-based), that allow for easy split and parallel processing of your jobs.\n\n# Description\nThis package provides two classes:\n- `ThreadParallelizer` to execute your jobs in new threads\n- `ProcessParallelizer` to execute your jobs in new processes\n\nThis is a pure python implementation, with usage of `threading` and `multiprocessing` packages\n\nNote that the wrappers appear to be in sync (from the caller's perspective), they will wait until all inner tasks are completed. \n\n# Installation\n \n## Normal installation\n\n```bash\npip install parallelizer\n```\n\n## Development installation\n\n```bash\ngit clone https://github.com/jpleorx/parallelizer.git\ncd parallelizer\npip install --editable .\n```\n\n# Example\n```python\nimport time\nfrom parallelizer import ThreadParallelizer, ProcessParallelizer, repeat\n\ndef power_function(base: int, power: int) -\u003e int:\n    time.sleep(1)\n    return base ** power\n\ninputs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\nnumber_of_threads = 5\n\nthread_parallelizer = ThreadParallelizer(number_of_threads)\nresults = thread_parallelizer.execute(power_function, [inputs, repeat(2, len(inputs))])\n\nprocess_parallelizer = ProcessParallelizer(number_of_threads)\nresults = process_parallelizer.execute(power_function, [inputs, repeat(2, len(inputs))])\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpleorx%2Fparallelizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpleorx%2Fparallelizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpleorx%2Fparallelizer/lists"}