skillfed

sgqlc

Simple GraphQL Client

sgqlc v18 3.2M downloads/30d#2,720 on PyPI553
Permissive license ISCL Active released

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 sgqlc

uv

uv add sgqlc

poetry

poetry add sgqlc

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Operating System :: OS IndependentProgramming Language :: PythonTopic :: Utilities

Tags

graphql client pythonquery graphql apispython graphql librarygraphql type declarationshttp graphql endpointgraphql query buildersimple graphql client
graphqlapi-clienthttp

More Utilities packages