{"id":18549164,"url":"https://github.com/lucarin91/casync","last_synced_at":"2025-05-15T09:10:53.965Z","repository":{"id":87142617,"uuid":"97852210","full_name":"lucarin91/casync","owner":"lucarin91","description":"Simple library to compose asynchronous functions in different patterns.","archived":false,"fork":false,"pushed_at":"2017-08-01T13:05:33.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-26T07:27:42.833Z","etag":null,"topics":["async","composition","parallel"],"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/lucarin91.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","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":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-20T15:38:00.000Z","updated_at":"2017-08-16T16:45:55.000Z","dependencies_parsed_at":"2023-03-13T19:47:00.993Z","dependency_job_id":null,"html_url":"https://github.com/lucarin91/casync","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/lucarin91%2Fcasync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucarin91%2Fcasync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucarin91%2Fcasync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucarin91%2Fcasync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucarin91","download_url":"https://codeload.github.com/lucarin91/casync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239269808,"owners_count":19610870,"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":["async","composition","parallel"],"created_at":"2024-11-06T20:38:09.390Z","updated_at":"2025-02-17T10:14:37.084Z","avatar_url":"https://github.com/lucarin91.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=================\ncasync - Async Composition\n=================\n\n..\n.. .. image:: https://img.shields.io/pypi/v/casync.svg\n..         :target: https://pypi.python.org/pypi/casync\n..\n.. .. image:: https://img.shields.io/travis/lucarin91/casync.svg\n..         :target: https://travis-ci.org/lucarin91/casync\n..\n.. .. image:: https://readthedocs.org/projects/async-composition/badge/?version=latest\n..         :target: https://async-composition.readthedocs.io/en/latest/?badge=latest\n..         :alt: Documentation Status\n..\n.. .. image:: https://pyup.io/repos/github/lucarin91/casync/shield.svg\n..      :target: https://pyup.io/repos/github/lucarin91/casync/\n..      :alt: Updates\n\n\nSimple library to compose asynchronous functions in different patterns. The composition creates a graph that can be executed in parallel by different kind of executor (i.e., thread pool, event loop).\n\n**DISCLAIMER:** this library is in early development stage. Most of the features are not available.\n\n.. * Documentation: https://async-composition.readthedocs.io.\n\nInstallation\n------------\n\nFor now, the library can be installed only from source and require Python 3. Download the repository with::\n\n  git clone https://github.com/lucarin91/casync\n\ninside the folder do this command to install the library::\n\n  python setup.py install\n\nAfter this, it is possible to tests the library using the examples in the ``examples`` folder.\n\nHow use\n--------\nIt is possible to compose functions in three different ways:\n\n* **Sequential composition** (``Seq``), execute all the function one after the other::\n\n  fun1 \u003e\u003e fun2\n\n* **And composition** (``And``), the functions are executed concurrently. After all the functions ended their execution their results are passed ahead as a list::\n\n  fun1 \u0026 fun2\n\n* **Or composition** (``Or``), the function are executed concurrently, but when the first function terminates all the other are stopped::\n\n  fun1 | fun2\n\nAn example of usage::\n\n  from casync import af, Executor\n\n  def fun1():\n    return 'hello'\n\n  def fun2():\n    return 'world'\n\n  def concat (s1, s2):\n    return s1 + ' ' + s2\n\n  comp1 = af(fun1) \u0026 af(fun2)\n  comp2 = af(fun1) | af(fun2)\n  comp3 = comp1 \u003e\u003e af(concat)\n\n\n  ex = Executor()\n  res = ex(comp1)  # ['hello', 'world']\n  res = ex(comp2)  # 'hello' or 'world'\n  res = ex(comp3)  # 'hello world'\n\n\nFeatures\n--------\n* Create a computational graph with ``and(\u0026)``, ``or(|)`` and ``seq(\u003e\u003e)`` constructors.\n* Execute graph in parallel using a python `multithreading` library.\n\nTodo\n----\n* Support of composition of all kind of function and lambdas.\n* Use decorators to easy the declaration of functions.\n* Implement synchronisation of data during the execution of the graph.\n* Implement different executors (i.e., event-loop with build in IO functionality).\n* support Python 2.7 at least.\n\nCredits\n---------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\nLicence\n----------\nMIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucarin91%2Fcasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucarin91%2Fcasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucarin91%2Fcasync/lists"}