Index: gi/__init__.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- gi/__init__.py	(revision 6a26d3f2b25b3fbbd87def14f1df17b96ed23a0d)
+++ gi/__init__.py	(revision 35ad1ec5f0a31e21e8aaaf1124b0e7068ebd4125)
@@ -84,28 +84,51 @@
         )
 
 
-def require_version(namespace, version):
+def require_version(namespace='', version='', requires_dict=None):
+    """ Ensures the correct versions are loaded when importing `gi` modules.
+
+    :param namespace: The name of a single module to require.
+    :type namespace: str or dict or None
+    :param version: The version to require.
+    :type version: str or None
+    :param requires_dict: The names and versions of multiple modules to require.
+    :type requires_dict: dict or None
+    :raises ValueError: If module/version is already loaded, already required, or unavailable.
+
+    Examples:
+
+        gi.require_version('Gtk', '3.0')
+        gi.require_version({'Gtk': '3.0', 'GLib': '2.0', 'Gio': '2.0'})
+
+    """
     repository = Repository.get_default()
+    requires = requires_dict if isinstance(requires_dict, dict) else dict()
 
-    if namespace in repository.get_loaded_namespaces():
-        loaded_version = repository.get_version(namespace)
-        if loaded_version != version:
-            raise ValueError('Namespace %s is already loaded with version %s' %
-                             (namespace, loaded_version))
+    if not isinstance(namespace, dict):
+        requires[namespace] = version
 
-    if namespace in _versions and _versions[namespace] != version:
-        raise ValueError('Namespace %s already requires version %s' %
-                         (namespace, _versions[namespace]))
+    for item_name, item_version in requires.items():
 
-    available_versions = repository.enumerate_versions(namespace)
+        if item_name in repository.get_loaded_namespaces():
+            loaded_version = repository.get_version(item_name)
+            if item_version != loaded_version:
+                raise ValueError(
+                    '{0} {1} is already loaded.'.format(item_name, loaded_version)
+                )
+
+        if item_name in _versions and _versions[item_name] != item_version:
+            raise ValueError(
+                '{0} {1} is already required.'.format(item_name, _versions[item_name])
+            )
+
+        available_versions = repository.enumerate_versions(item_name)
-    if not available_versions:
+        if not available_versions:
-        raise ValueError('Namespace %s not available' % namespace)
+            raise ValueError('{0} is not available'.format(item_name))
 
-    if version not in available_versions:
-        raise ValueError('Namespace %s not available for version %s' %
-                         (namespace, version))
+        if item_version not in available_versions:
+            raise ValueError('{0} {1} is not available.'.format(item_name, item_version))
 
-    _versions[namespace] = version
+        _versions[item_name] = item_version
 
 
 def get_required_version(namespace):
