--- id: sgqlc version: "18" license: ISCL license_treatment: permissive maintenance: active --- # sgqlc — Simple GraphQL Client License: permissive · Maintenance: active · Downloads: 3.2M/mo ## 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 above — 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 pip install sgqlc uv add sgqlc 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_current - Install friction: low - Maintenance: active - Downloads: 3.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags graphql client python, query graphql apis, python graphql library, graphql type declarations, http graphql endpoint, graphql query builder, simple graphql client, graphql, api-client, http [View on SkillFed](https://skillfed.io/packages/sgqlc) · [View on PyPI](https://pypi.org/project/sgqlc/)