sgqlc
Simple GraphQL Client
What it is and what it does
sgqlc lets you write GraphQL queries as Python code instead of mixing GraphQL strings into your application. It provides modules to declare GraphQL types in Python, generate and interpret queries programmatically, and access GraphQL endpoints over HTTP. The core motivation is to avoid the friction of embedding a domain-specific language in Python code, to use Python's naming conventions (snake_case instead of camelCase), and to enable dynamic query construction that always produces valid GraphQL.
The package includes built-in support for datetime types with ISO 8601 bindings, Relay cursor connection patterns, and introspection-based schema handling. It depends only on graphql-core, making it lightweight. The library is designed for developers building applications that consume GraphQL APIs from services like GitHub, Shopify, or Yelp, where you want to fetch only the fields you need in a single request rather than making multiple REST calls or parsing deeply nested JSON dictionaries.
Use it for:
- Query GitHub's GraphQL API to fetch pull request details, commits, comments, and reviews in a single request using Python objects.
- Build dynamic GraphQL queries based on user input or runtime conditions without string concatenation or manual query validation.
- Consume Shopify or Yelp GraphQL endpoints while automatically parsing custom scalar types like dates into native Python datetime objects.
- Reduce API latency by combining multiple related data fetches into one nested GraphQL query instead of sequential HTTP requests.
- Explore and introspect GraphQL schemas programmatically to generate type-safe query builders for your application.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
sgqlc is a Python client library for querying GraphQL APIs using Python syntax instead of GraphQL's domain-specific language, with support for type declarations, query generation, and HTTP endpoint access.
Yes. sgqlc is actively maintained, has no known vulnerabilities, low install friction, and solves a real problem for developers working with GraphQL APIs. The permissive ISC license poses no restrictions. Install it if you regularly query GraphQL endpoints and prefer writing Python over embedding GraphQL strings.
Install
sgqlc on PyPI
pip
pip install sgqlcuv
uv add sgqlcpoetry
poetry add sgqlcInstalling sgqlc
Before you install
Low install friction with a single runtime dependency (graphql-core). The package is actively maintained with a recent release on 2026-02-06 and an active repository showing ongoing development.
License in practice
Licensed under ISC (ISCL), a permissive open-source license that allows commercial and private use with minimal restrictions.
Quickstart
pip install sgqlc
from sgqlc.types import Type, Field, String
from sgqlc.endpoint import http
endpoint = http.HTTPEndpoint('https://api.example.com/graphql')
query = endpoint(query_object)
Requires Python 3.8 or later (supports current Python versions, up to but not including 4.x).
Verify before relying
- Whether sgqlc supports authentication schemes (API keys, OAuth, bearer tokens) for protected GraphQL endpoints.
- Performance characteristics when handling large nested queries or high-volume API calls.
- Whether the package provides built-in caching or request batching capabilities.
Package facts
| License | ISCL (permissive) |
| Python support | supports the current Python release (<4,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — graphql-core |
| Maintenance | actively maintained — 189 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,161,084/month — #2,720 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sgqlc-18-py3-none-any.whl
Keywords: graphql, client, http, endpoint
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
enigma-api-clientPython SDK for querying Enigma's GraphQL…
permissive · top 15,000 on PyPI
graphqlclientA lightweight GraphQL client that sends queries…
permissive · top 15,000 on PyPI
gqlA GraphQL client for Python that executes…
permissive · top 1,000 on PyPI
graphql-queryBuilds GraphQL query strings programmatically…
permissive · top 15,000 on PyPI
python-graphql-clientSends GraphQL queries, mutations, and…
permissive · top 15,000 on PyPI
pycarloPycarlo is Monte Carlo's Python SDK for…
permissive · top 5,000 on PyPI
ariadne-codegenGenerates fully typed, asynchronous Python…
permissive · top 5,000 on PyPI
Flask-GraphQLAdds a GraphQL endpoint to Flask applications,…
permissive · top 15,000 on PyPI
grapheneGraphene is a Python library for building…
permissive · top 1,000 on PyPI
crowdin-api-clientA lightweight Python client library for the…
permissive · top 15,000 on PyPI