{"id":14975985,"url":"https://github.com/ariebovenberg/quiz","last_synced_at":"2025-04-05T08:04:22.724Z","repository":{"id":31501230,"uuid":"128090142","full_name":"ariebovenberg/quiz","owner":"ariebovenberg","description":"🎱 Capable GraphQL client for Python","archived":false,"fork":false,"pushed_at":"2025-04-02T07:13:36.000Z","size":1693,"stargazers_count":69,"open_issues_count":13,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T08:24:26.962Z","etag":null,"topics":["aiohttp","api-client","async","graphql","graphql-client","http-client","requests"],"latest_commit_sha":null,"homepage":"https://quiz.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ariebovenberg.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-04T16:30:15.000Z","updated_at":"2025-04-02T07:13:39.000Z","dependencies_parsed_at":"2024-04-17T05:25:31.739Z","dependency_job_id":"9c906d7a-f549-46ed-a3d6-5aa9238d5daa","html_url":"https://github.com/ariebovenberg/quiz","commit_stats":{"total_commits":835,"total_committers":10,"mean_commits":83.5,"dds":0.6826347305389222,"last_synced_commit":"1614c7585021a8baa8fc3314b002ff58c3cce3a2"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariebovenberg%2Fquiz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariebovenberg%2Fquiz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariebovenberg%2Fquiz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariebovenberg%2Fquiz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ariebovenberg","download_url":"https://codeload.github.com/ariebovenberg/quiz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305932,"owners_count":20917208,"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":["aiohttp","api-client","async","graphql","graphql-client","http-client","requests"],"created_at":"2024-09-24T13:53:05.549Z","updated_at":"2025-04-05T08:04:22.703Z","avatar_url":"https://github.com/ariebovenberg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"🎱 Quiz\n=======\n\n.. image:: https://img.shields.io/pypi/v/quiz.svg?style=flat-square\n   :target: https://pypi.python.org/pypi/quiz\n\n.. image:: https://img.shields.io/pypi/l/quiz.svg?style=flat-square\n   :target: https://pypi.python.org/pypi/quiz\n\n.. image:: https://img.shields.io/pypi/pyversions/quiz.svg?style=flat-square\n   :target: https://pypi.python.org/pypi/quiz\n\n.. image:: https://img.shields.io/readthedocs/quiz.svg?style=flat-square\n   :target: http://quiz.readthedocs.io/\n\n.. image:: https://img.shields.io/codecov/c/github/ariebovenberg/quiz.svg?style=flat-square\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAaCAMAAACaYWzBAAABX1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8P/Ub/AAAAdHRSTlMAAQIDBAUGBw0PERIVFhcZGhsgISQmKSorLS8zODk6PUFDR0lLTE1YXF5fYGRlaHB1dnd4eXt/g4eKjJKVlpeYmZqcnqOkpaanqqusrq+xsrW3ubu8vb7Hzc7Q1dfZ3N3e3+Dh4ujp6uzt7/Hz9fb3+Pv9/mHMvTIAAAFPSURBVHgBbdDXcxJRGIbx55zvnI1ijJI1YuxiEkWNsRjsKPYiFuxFsRdREH3//5Hd2YvMLL/bZ76L9yMTYe74o95g+L57qgaRQiC9qbF+X2N35zBHxmj80bC9mFYqs/sv/NLfZXxWAiekq5soTLekJgaRw9IyxOCd8yHCIekoEbaMdITEKFhCQ/9qwB1dIWGNhIu6D9s0qDJlnoIPU8z0tZ1VXSITDMACmfNq8liL0/X6jnXgIcCGXUsLmxf0jA96q7Fv7RQz5m/kI9/pI1+lTw/vvZC0F1YkPb/V6Uk/0Ot6ANJrn2c4KbVmAbfvlTgNmDmosidf6s2AVYpnmoenOlssjUBw5Iyt+lnByLkAhchB3SZQEjmmM8RJYUXnJoXAkp5glHg2/laNZNLJZXUh8a588l3XHWWB3SO9aVTXW7nMv5TUwblS4cCDLzsx4D/omEB2BXPuawAAAABJRU5ErkJggg==\n   :target: https://codecov.io/gh/ariebovenberg/quiz\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square\n   :target: https://github.com/psf/black\n\nCapable GraphQL client for Python.\n\nFeatures:\n\n* Sync/async compatible, pluggable HTTP clients.\n* Auto-generate typed and documented python APIs\n* ORM-like syntax to write GraphQL.\n\nNote that this project is in an early alpha stage.\nSome features are not yet implemented (see the roadmap below),\nand it may be a little rough around the edges.\nIf you encounter a problem or have a feature request,\ndon't hesitate to open an issue in the `issue tracker \u003chttps://github.com/ariebovenberg/quiz/issues\u003e`_.\n\n\nQuickstart\n----------\n\nA quick 'n dirty request to GitHub's new V4 API:\n\n.. code-block:: python3\n\n   \u003e\u003e\u003e import quiz\n   \u003e\u003e\u003e query = '''\n   ...   {\n   ...     repository(owner: \"octocat\", name: \"Hello-World\") {\n   ...       createdAt\n   ...       description\n   ...     }\n   ...   }\n   ... '''\n   \u003e\u003e\u003e quiz.execute(query, url='https://api.github.com/graphql',\n   ...              auth=('me', 'password'))\n   {\"repository\": ...}\n\n\nFeatures\n--------\n\n1. **Adaptability**. Built on top of `snug \u003chttp://snug.readthedocs.io/\u003e`_,\n   quiz supports different HTTP clients\n\n   .. code-block:: python3\n\n      import requests\n      result = quiz.execute(query, ..., client=requests.Session())\n\n   as well as async execution\n   (optionally with `aiohttp \u003chttp:aiohttp.readthedocs.io/\u003e`_):\n\n   .. code-block:: python3\n\n      result = await quiz.execute_async(query, ...)\n\n2. **Typing**.\n   Convert a GraphQL schema into documented python classes:\n\n   .. code-block:: python3\n\n      \u003e\u003e\u003e schema = quiz.Schema.from_url('https://api.github.com/graphql',\n      ...                               auth=('me', 'password'))\n      \u003e\u003e\u003e help(schema.Repository)\n      class Repository(Node, ProjectOwner, Subscribable, Starrable,\n       UniformResourceLocatable, RepositoryInfo, quiz.types.Object)\n       |  A repository contains the content for a project.\n       |\n       |  Method resolution order:\n       |      ...\n       |\n       |  Data descriptors defined here:\n       |\n       |  assignableUsers\n       |      : UserConnection\n       |      A list of users that can be assigned to issues in this repo\n       |\n       |  codeOfConduct\n       |      : CodeOfConduct or None\n       |      Returns the code of conduct for this repository\n       ...\n\n\n3. **GraphQL \"ORM\"**. Write queries as you would with an ORM:\n\n   .. code-block:: python3\n\n      \u003e\u003e\u003e _ = quiz.SELECTOR\n      \u003e\u003e\u003e query = schema.query[\n      ...     _\n      ...     .repository(owner='octocat', name='Hello-World')[\n      ...         _\n      ...         .createdAt\n      ...         .description\n      ...     ]\n      ... ]\n      \u003e\u003e\u003e str(query)\n      query {\n        repository(owner: \"octocat\", name: \"Hello-World\") {\n          createdAt\n          description\n        }\n      }\n\n4. **Offline query validation**. Use the schema to catch errors quickly:\n\n   .. code-block:: python3\n\n      \u003e\u003e\u003e schema.query[\n      ...     _\n      ...     .repository(owner='octocat', name='Hello-World')[\n      ...         _\n      ...         .createdAt\n      ...         .foo\n      ...         .description\n      ...     ]\n      ... ]\n      SelectionError: SelectionError on \"Query\" at path \"repository\":\n\n          SelectionError: SelectionError on \"Repository\" at path \"foo\":\n\n              NoSuchField: field does not exist\n\n5. **Deserialization into python objects**. Responses are loaded into the schema's types.\n   Use ``.`` to access fields:\n\n   .. code-block:: python3\n\n      \u003e\u003e\u003e r = quiz.execute(query, ...)\n      \u003e\u003e\u003e r.repository.description\n      \"My first repository on GitHub!\"\n      \u003e\u003e\u003e isinstance(r.repository, schema.Repository)\n      True\n\n   If you prefer the raw JSON response, you can always do:\n\n   .. code-block:: python3\n\n      \u003e\u003e\u003e quiz.execute(str(query), ...)\n      {\"repository\": ...}\n\n\nInstallation\n------------\n\n``quiz`` and its dependencies are pure python. Installation is easy as:\n\n.. code-block:: bash\n\n   pip install quiz\n\n\nContributing\n------------\n\nAfter you've cloned the repo locally, set up the development environment\nwith:\n\n.. code-block:: bash\n\n   make init\n\nFor quick test runs, run:\n\n.. code-block:: bash\n\n   pytest\n\nTo run all tests and checks on various python versions, run:\n\n.. code-block:: bash\n\n   make test\n\nGenerate the docs with:\n\n.. code-block:: bash\n\n   make docs\n\n\nPull requests welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariebovenberg%2Fquiz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fariebovenberg%2Fquiz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariebovenberg%2Fquiz/lists"}