{
    "mode": "pydoc",
    "parameter": "gi",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/gi/json",
    "generated": "2026-06-02T15:51:12Z",
    "sections": {
        "NAME": {
            "content": "gi\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "# -*- Mode: Python; py-indent-offset: 4 -*-\n# vim: tabstop=4 shiftwidth=4 expandtab\n#\n# Copyright (C) 2005-2009 Johan Dahlin <johan@gnome.org>\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301\n# USA\n",
            "subsections": []
        },
        "PACKAGE CONTENTS": {
            "content": "constants\nerror\ngi\ngtktemplate\noption\nossighelper\npropertyhelper\nsignalhelper\ndocstring\nimporter\nmodule\noverrides (package)\npygtkcompat\nrepository (package)\ntypes\n",
            "subsections": []
        },
        "SUBMODULES": {
            "content": "gobject\n",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.DeprecationWarning(builtins.Warning)\nPyGIDeprecationWarning\nbuiltins.Warning(builtins.Exception)\nPyGIWarning\nbuiltins.object\nRepository\n",
            "subsections": [
                {
                    "name": "class PyGIDeprecationWarning",
                    "content": "|  Method resolution order:\n|      PyGIDeprecationWarning\n|      builtins.DeprecationWarning\n|      builtins.Warning\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.DeprecationWarning:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.DeprecationWarning:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class PyGIWarning",
                    "content": "|  Method resolution order:\n|      PyGIWarning\n|      builtins.Warning\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Warning:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Warning:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                },
                {
                    "name": "class Repository",
                    "content": "|  Methods defined here:\n|\n|  enumerateversions(...)\n|\n|  findbyname(...)\n|\n|  getdependencies(...)\n|\n|  getimmediatedependencies(...)\n|\n|  getinfos(...)\n|\n|  getloadednamespaces(...)\n|\n|  gettypelibpath(...)\n|\n|  getversion(...)\n|\n|  isregistered(...)\n|\n|  require(...)\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  getdefault(...)\n"
                }
            ]
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "check_version",
                    "content": ""
                },
                {
                    "name": "get_required_version",
                    "content": ""
                },
                {
                    "name": "require_foreign",
                    "content": "Ensure the given foreign marshaling module is available and loaded.\n\n:param str namespace:\nIntrospection namespace of the foreign module (e.g. \"cairo\")\n:param symbol:\nOptional symbol typename to ensure a converter exists.\n:type symbol: str or None\n:raises: ImportError\n\n:Example:\n\n.. code-block:: python\n\nimport gi\nimport cairo\ngi.requireforeign('cairo')\n"
                },
                {
                    "name": "require_version",
                    "content": "Ensures the correct versions are loaded when importing `gi` modules.\n\n:param namespace: The name of module to require.\n:type namespace: str\n:param version: The version of module to require.\n:type version: str\n:raises ValueError: If module/version is already loaded, already required, or unavailable.\n\n:Example:\n\n.. code-block:: python\n\nimport gi\ngi.requireversion('Gtk', '3.0')\n"
                },
                {
                    "name": "require_versions",
                    "content": "Utility function for consolidating multiple `gi.requireversion()` calls.\n\n:param requires: The names and versions of modules to require.\n:type requires: dict\n\n:Example:\n\n.. code-block:: python\n\nimport gi\ngi.requireversions({'Gtk': '3.0', 'GLib': '2.0', 'Gio': '2.0'})\n"
                }
            ]
        },
        "DATA": {
            "content": "versioninfo = (3, 42, 1)\n",
            "subsections": []
        },
        "VERSION": {
            "content": "3.42.1\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3/dist-packages/gi/init.py\n\n",
            "subsections": []
        }
    },
    "summary": "gi",
    "flags": [],
    "examples": [],
    "see_also": []
}