Skip to main content

Installation

Current published release: grantex==0.3.14 (verified July 12, 2026).
The unpinned python -m pip install grantex command follows PyPI’s current release. Keep the exact version above in reproducible builds. See Release Status before upgrading.

Requirements

  • Python 3.9 or higher
  • httpx (sync HTTP client)
  • PyJWT >= 2.8 with cryptography (for offline token verification)
All dependencies are installed automatically with the SDK.

Quick Start

Configuration

The Grantex client accepts three keyword-only arguments:

API Key Resolution

The client resolves the API key in this order:
  1. The api_key keyword argument passed to the constructor.
  2. The GRANTEX_API_KEY environment variable.
If neither is set, a ValueError is raised.

Context Manager

The Grantex client implements the context manager protocol. Using with ensures the underlying HTTP connection pool is properly closed when you are done:
This is equivalent to calling client.close() manually:

Resource Clients

The Grantex client exposes the following resource clients as attributes:

Standalone Functions

In addition to the client, the SDK exports standalone utility functions:

Data Model Conventions

All response types are frozen dataclasses with snake_case field names. Lists are returned as Python tuple objects for immutability.
Last modified on July 12, 2026