{"id":16032480,"url":"https://github.com/virtuald/pygi-gio-coroutines","last_synced_at":"2026-05-16T08:40:11.500Z","repository":{"id":62580615,"uuid":"45353411","full_name":"virtuald/pygi-gio-coroutines","owner":"virtuald","description":"Make asynchronous I/O using PyGObject+Gio easier!","archived":false,"fork":false,"pushed_at":"2015-11-02T05:40:39.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-21T15:43:23.688Z","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":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/virtuald.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2015-11-01T19:05:03.000Z","updated_at":"2016-06-16T22:27:37.000Z","dependencies_parsed_at":"2022-11-03T20:49:48.502Z","dependency_job_id":null,"html_url":"https://github.com/virtuald/pygi-gio-coroutines","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/virtuald/pygi-gio-coroutines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fpygi-gio-coroutines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fpygi-gio-coroutines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fpygi-gio-coroutines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fpygi-gio-coroutines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/virtuald","download_url":"https://codeload.github.com/virtuald/pygi-gio-coroutines/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fpygi-gio-coroutines/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267376369,"owners_count":24077300,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-08T21:22:46.100Z","updated_at":"2026-05-16T08:40:11.452Z","avatar_url":"https://github.com/virtuald.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pygi-gio-coroutines\n===================\n\nThis is a prototype for a single-file library that allows you to integrate\npython coroutines with Gio's asynchronous operations. Gio provides a lot of\nasynchronous I/O support, but they're a bit clunky to use and this makes it\na little easier to chain I/O operations together.\n\nThis implementation was developed for the `Exaile audio player \u003chttp://www.exaile.org\u003e`_\nto help us as we move to GTK3. I'm still feeling this out to see what bugs\ncome up, so please provide feedback!\n\nThere's a lot of features that could be added to such a project. I've added\nthings that are useful for me now, feel free to add your own. Some ideas:\n\n* Transparent support for cancellation\n\n  * Cancellation of I/O\n  * Cancellation of the coroutine\n  \nUsage\n=====\n\n.. code:: python\n\n  from gio_coroutines import gio_coroutine, async, idle, Return\n  \n  @gio_coroutine\n  def lots_of_io():\n  \n    ..\n    \n    # Async write operation\n    result = yield async(f, 'write', bytes, 0, None)\n    \n    .. \n    \n    # Delay execution via GLib.idle_add\n    yield idle\n    \n    # return some value\n    raise Return('val')\n    \n  def on_done(r):\n    try:\n      retval = r.result()\n    except:\n      logger.exception(\"Some bad thing happened\")\n  \n  lots_of_io(on_done=on_done)\n  \nRequirements\n============\n\n* PyGObject + Gio\n\nInstallation\n============\n\nThis project is easily installed via pip:\n\n  pip install pygi-gio-coroutines\n\nAuthor\n======\n\nDustin Spicuzza (dustin@virtualroadside.com)\n\nPortions of the code were inspired by Tornado's coroutine + futures\nimplementation.\n\nLicense\n=======\n\nLGPL 2.1+ (Same as PyGI)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtuald%2Fpygi-gio-coroutines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirtuald%2Fpygi-gio-coroutines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtuald%2Fpygi-gio-coroutines/lists"}