{"id":15475508,"url":"https://github.com/willingc/pyquery-ql","last_synced_at":"2025-04-11T00:42:06.146Z","repository":{"id":149802163,"uuid":"113881701","full_name":"willingc/pyquery-ql","owner":"willingc","description":"Query GitHub API v4 using GraphQL","archived":false,"fork":false,"pushed_at":"2017-12-16T13:46:11.000Z","size":122,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-11T00:41:57.485Z","etag":null,"topics":["github-api","graphql","graphql-client","python","requests"],"latest_commit_sha":null,"homepage":"http://pyquery-ql.readthedocs.io","language":"Jupyter Notebook","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/willingc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-12-11T16:24:10.000Z","updated_at":"2023-12-05T15:04:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"3df5b806-3963-4512-a0f6-152e56ddd357","html_url":"https://github.com/willingc/pyquery-ql","commit_stats":{"total_commits":47,"total_committers":1,"mean_commits":47.0,"dds":0.0,"last_synced_commit":"fee0ba5e2c36b7ff28e874d68a8b53ff90c6d423"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willingc%2Fpyquery-ql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willingc%2Fpyquery-ql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willingc%2Fpyquery-ql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willingc%2Fpyquery-ql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willingc","download_url":"https://codeload.github.com/willingc/pyquery-ql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322601,"owners_count":21084336,"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":["github-api","graphql","graphql-client","python","requests"],"created_at":"2024-10-02T03:14:22.964Z","updated_at":"2025-04-11T00:42:06.131Z","avatar_url":"https://github.com/willingc.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyquery-ql\n\n[![Documentation Status](http://readthedocs.org/projects/pyquery-ql/badge/?version=latest)](http://pyquery-ql.readthedocs.io/en/latest/?badge=latest)\n\nQuery [GitHub API v4](https://developer.github.com/v4/) using a lightweight\n[GraphQL](http://graphql.org) client\n\n## What is pyquery-ql?\n\nIt's a repository for examples and tips when querying GraphQL APIs using\n[Python](https://python.org) and the popular [Jupyter](https://jupyter.org)\nnotebook. It provides examples on using the\nelegant [requests](https://requests.org) library and *pandas* to do data\ncollection and interactive\ndata exploration.\n\n**pyquery-ql** is also a very early prototype for a lightweight Python\nGraphQL client. It's based on Python 3.6 or higher and takes advantage of\nf-strings (if you haven't tried them yet, please do).\n\n## Why create a lightweight GraphQL client for Python?\n\nIn data science and scientific programming, we do lots of queries for data\nfrom different sources. With the increased use of GraphQL, it's helpful to\nhave a lightweight client to do quick queries.\n\nWith [Jupyter](https://jupyter.org) and [nteract](https://nteract.io)\nnotebooks, it's critical to one's workflow to be\nable to prototype and iterate from within the notebook. While full featured\nclients, like [Apollo Client](https://www.apollographql.com/client/), and\nexplorers, such as [GitHub's GraphQL Explorer](https://developer.github.com/v4/explorer/),\nare wonderful, the user must leave the notebook to see their benefits.\n\nUsing the Jupyter or nteract notebooks, a user explores data, and GraphQL is\nfun to use since it's very easy to introspect the data source. A lightweight\nPython client provides a simple way to bridge the data and\nthe Python scientific stack, especially pandas, from within the interactive\nnotebook.\n\n## Installation\n\nSupports Python 3.6+\n\n1. Clone the repo.\n\n        git clone https://github.com/willingc/pyquery-ql.git\n\n2. Set up your GitHub API token to avoid rate limit and export to your\n   environment:\n\n        export GITHUB_API_TOKEN = '......'\n\n### pip installation instructions\n\n3. From the root of the cloned repo:\n\n        pip install -r requirements.txt\n\n###  conda installation instructions\n\n3. Create the conda environment:\n\n        conda env create -f environment.yml\n\n4. Activate the environment:\n\n        source activate pyquery\n\n## Usage\n\nTo run:\n\n    python3 pyquery-ql.py\n\n## License\n\nMIT\n\n---\n\n## GraphQL info\n\n- [GraphQL](http://graphql.org)\n    - describe your data\n    - ask for what you want\n    - get predictable results\n\n- A [GraphQL service](http://graphql.org/learn/queries/) defines **types**\n  and **fields** on those types. A function is created for each field on\n  each type.\n\n    - **field** can be a specific type (like String) or an Object\n    - **arguments** can be passed to fields when making a query\n        ```\n        {\n          human(id: \"1000\") {\n            name\n            height\n          }\n        }\n\n- GraphQL schema and types\n    ```\n    type Character {\n      name: String!\n      appearsIn: [Episode]!\n    }\n    ```\n\n    - GraphQL Object type `Character`\n    - fields `name` and `appearsIn`\n    - Scalar type `String`\n    - `!` non-nullable (will always return a value when queried)\n    - array `[Episode]`\n\n- Arguments\n\n    - every field can have 0 or more arguments\n    - all arguments are named\n    - all arguments are passed by name specifically (unlike JS or Python\n      where functions take a list of ordered arguments\n    - required or optional\n\n-  Scalar types\n\n    - fields that resolve to real data\n    - leaves of the query\n    - default scalar types:\n        - `Int`\n        - `Float`\n        - `String`\n        - `Boolean`\n        - `ID` unique identifier\n     - custom scalar types are possible i.e. `Date`\n     - `Enums`\n\n- Modifiers: Non-Null and List (array)\n    - List [] can be null\n    - a member of the list can not be null or it will generate an error\n    - []! the actual list can not be null though a member can be null\n\n- [**Introspection**](http://graphql.org/learn/introspection/) is a beautiful\n  thing; ask for `__schema` for all the good stuff on the types\n\n## GraphQL Client - deeper dive\n\n- [Pagination](http://graphql.org/learn/introspection/)\n    - plurals\n    - slicing\n    - pagination and edges\n    - Connections\n- [Caching](http://graphql.org/learn/caching/)\n    - ID\n    - pros and cons of globally unique IDs\n    - server defined or client derived are both options\n\n## GraphQL spec\n\n- [The Spec](http://facebook.github.io/graphql/October2016/)\n- [Response Format](http://facebook.github.io/graphql/October2016/#sec-Response-Format)\n- [Grammar Summary](http://facebook.github.io/graphql/October2016/#sec-Appendix-Grammar-Summary)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillingc%2Fpyquery-ql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillingc%2Fpyquery-ql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillingc%2Fpyquery-ql/lists"}