{"id":18402199,"url":"https://github.com/gerapy/acinonyx","last_synced_at":"2025-04-12T17:53:53.690Z","repository":{"id":86326902,"uuid":"282951677","full_name":"Gerapy/Acinonyx","owner":"Gerapy","description":"A package which can simplify your multiprocessing implementation","archived":false,"fork":false,"pushed_at":"2020-07-27T16:25:25.000Z","size":7,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T03:41:40.313Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gerapy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-27T16:19:19.000Z","updated_at":"2022-08-01T09:29:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2265a30-db9c-4771-a023-409fe7f532cf","html_url":"https://github.com/Gerapy/Acinonyx","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gerapy%2FAcinonyx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gerapy%2FAcinonyx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gerapy%2FAcinonyx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gerapy%2FAcinonyx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gerapy","download_url":"https://codeload.github.com/Gerapy/Acinonyx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610409,"owners_count":21132920,"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":[],"created_at":"2024-11-06T02:41:34.970Z","updated_at":"2025-04-12T17:53:53.656Z","avatar_url":"https://github.com/Gerapy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Acinonyx\n\nAsinoyx is a package which can simplify your multiprocessing implementation, also you \ncan easily watch the progress of multiprocessing execution.\n\n## Installation\n\nYou can install this package by this command:\n\n```shell script\npip3 install acinonyx\n```\n\n## Usage\n\nA simple sample:\n\n```python\nimport time\nfrom random import random\nfrom acinonyx import run\n\ndef log(val):\n    time.sleep(random())\n    return val\n\nvalues = range(100)\nprint(run(log, values))\n```\n\nIt will run with `cpu_count` processes and print progress bar, output is below:\n\n```\n1%|█       | 1/100 [00:01\u003c00:40,  2.29it/s]\n26%|██       | 26/100 [00:01\u003c00:32,  21.29it/s]\n100%|██████████| 100/100 [00:03\u003c00:00, 26.86it/s]\n[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..., 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]\n```\n\nAlso you can use multiple args:\n\n```python\nimport time\nfrom random import random\nfrom acinonyx import run\n\ndef add(a, b):\n    time.sleep(random())\n    return a + b\n\nif __name__ == '__main__':\n    values = [(i, i) for i in range(100)]\n    print(run(add, values))\n```\n\nAlso you can use it in other scenario such as web spider:\n\n```python\nimport requests\nfrom random import random\nimport time\nfrom acinonyx import irun\n\ndef fetch():\n    delay = random()\n    url = 'https://httpbin.org/uuid'\n    time.sleep(delay)\n    return requests.get(url).json().get('uuid')\n\nif __name__ == '__main__':\n    for result in irun(fetch, range(10), ordered=False):\n        print(result)\n```\n\n## Trouble Shooting\n\n### NSPlaceholderDate initialize error\n\n```shell script\nobjc[67206]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called\n```\n\nTry to set env before execute script:\n \n```shell script\nexport OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerapy%2Facinonyx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerapy%2Facinonyx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerapy%2Facinonyx/lists"}