{"id":15756057,"url":"https://github.com/lazka/giofile","last_synced_at":"2025-04-30T17:43:48.803Z","repository":{"id":57434356,"uuid":"99409324","full_name":"lazka/giofile","owner":"lazka","description":"Opens a Gio.File as a Python file object","archived":false,"fork":false,"pushed_at":"2017-12-15T09:32:54.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T18:23:43.516Z","etag":null,"topics":["gio","pygobject","python"],"latest_commit_sha":null,"homepage":null,"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/lazka.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":"2017-08-05T08:18:05.000Z","updated_at":"2024-09-21T05:50:39.000Z","dependencies_parsed_at":"2022-08-27T21:11:47.098Z","dependency_job_id":null,"html_url":"https://github.com/lazka/giofile","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lazka%2Fgiofile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lazka%2Fgiofile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lazka%2Fgiofile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lazka%2Fgiofile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lazka","download_url":"https://codeload.github.com/lazka/giofile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251753689,"owners_count":21638367,"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":["gio","pygobject","python"],"created_at":"2024-10-04T08:41:41.715Z","updated_at":"2025-04-30T17:43:48.780Z","avatar_url":"https://github.com/lazka.png","language":"Python","readme":"*******\ngiofile\n*******\n\nOpens a Gio.File as a Python file object\n\n.. code:: python\n\n    def open(file, mode=\"r\", buffering=-1, encoding=None, errors=None,\n             newline=None, cancellable=None):\n        \"\"\"\n        Like io.open() but takes a Gio.File instead of a filename.\n\n        The only modes supported are r/rw/rb/r+b\n        Takes a cancellable kwarg for passing a Gio.Cancellable().\n        Cancelling it will abort any ongoing blocking operation.\n\n        Returns a io.IOBase instance.\n        \"\"\"\n\n.. image:: https://travis-ci.org/lazka/giofile.svg?branch=master\n    :target: https://travis-ci.org/lazka/giofile\n\nInstallation\n============\n\n::\n\n    pip install giofile\n\nExample\n=======\n\n.. code:: python\n\n    import mutagen\n    import giofile\n    from gi.repository import Gio\n\n    gio_file = Gio.File.new_for_uri(\n        \"http://people.xiph.org/~giles/2012/opus/ehren-paper_lights-96.opus\")\n\n    cancellable = Gio.Cancellable.new()\n    with giofile.open(gio_file, \"rb\", cancellable=cancellable) as gfile:\n        print(mutagen.File(gfile).pprint())\n\n.. code:: sh\n\n    $ python example.py\n    Ogg Opus, 228.11 seconds (audio/ogg)\n    ENCODER=opusenc from opus-tools 0.1.5\n    artist=Ehren Starks\n    title=Paper Lights\n    album=Lines Build Walls\n    date=2005-09-05\n    copyright=Copyright 2005 Ehren Starks\n    license=http://creativecommons.org/licenses/by-nc-sa/1.0/\n    organization=magnatune.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazka%2Fgiofile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flazka%2Fgiofile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazka%2Fgiofile/lists"}