
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
py2graphql
Advanced tools
py2graphql (Python to GraphQL) ##############################
|pypi|
__getattr__ abusepy2graphql is a Python GraphQL client that makes GraphQL feel better to use. It almost feels like you're using Django's ORM.
.. code-block:: bash :class: ignore
pip install py2graphql
This Python equates to the following GraphQL.
.. code-block:: python :class: ignore
from py2graphql import Query
Query().repository(owner='juliuscaeser', name='rome').pullRequest(number=2).values('title', 'url').commits(last=250).edges.node.commit.values('id', 'message', 'messageBody')
.. code-block:: graphql :class: ignore
query { repository(owner: "juliuscaeser", name: "rome") { pullRequest(number: 2) { title url commits(last: 250) { edges { node { commit { id message messageBody } } } } } } }
You can even use the library to do the HTTP requests:
.. code-block:: python :class: ignore
from py2graphql import Client
headers = { 'Authorization': 'token MY_TOKEN', } Client(url=THE_URL, headers=headers).query().repository(owner='juliuscaeser', name='rome').fetch()
It also supports Mutations:
.. code-block:: python :class: ignore
from py2graphql import Client, Query
headers = { 'Authorization': 'token MY_TOKEN', } client = Client(url=THE_URL, headers=headers) mutation = Query(name='mutation', client=client)
And multiple queries in a single request:
.. code-block:: python :class: ignore
from py2graphql import Client, Query
headers = { 'Authorization': 'token MY_TOKEN', } query = Client(url=THE_URL, headers=headers).query().repository(owner='juliuscaeser', name='rome') query.pullRequest(number=2).values('title', 'url') query.releases(first=10).edges.node.values('name') query.get_graphql()
.. code-block:: graphql :class: ignore
query { repository(owner: "juliuscaeser", name: "rome") { pullRequest(number: 2) { title url } releases(first: 10) { edges { node { name } } } } }
As well as GraphQL errors:
.. code-block:: python :class: ignore
from py2graphql import Client, Query
headers = { 'Authorization': 'token MY_TOKEN', } result = Client(url=THE_URL, headers=headers).query().repository(owner='juliuscaeser', name='rome').fetch() result._errors [{'message': "Field 'repository' is missing required arguments: name", 'locations': [{'line': 7, 'column': 3}]}]
.. |pypi| image:: https://img.shields.io/pypi/v/py2graphql.svg?style=flat :target: https://pypi.python.org/pypi/py2graphql
FAQs
Pythonic GraphQL Client
We found that py2graphql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.