--- id: glean-api-client version: "0.15.5" license: unclear license_treatment: unclear maintenance: active --- # glean-api-client — Python Client SDK Generated by Speakeasy. License: unclear · Maintenance: active · Downloads: 105.4K/mo ## What it is and what it does glean-api-client is a Python SDK generated by Speakeasy that wraps Glean's REST API, offering type-safe access to both the Client API (for search and retrieval) and the Indexing API (for content and permission management). It is built on httpx for HTTP transport and pydantic for request/response validation, and supports both blocking and async workflows via the same client instance. Developers use it to integrate Glean search and indexing into Python applications without manually constructing HTTP requests. The SDK includes full type hints for all parameters and responses, making it suitable for IDEs with Pydantic support (especially PyCharm with the Pydantic plugin). It handles authentication via API tokens, supports streaming responses, and provides retry and error-handling mechanisms. Use it for: - Build a Python web app that searches Glean content and displays results to end users via the Client API. - Index documents and manage permissions in Glean programmatically from a Python backend service. - Stream chat or search responses asynchronously in a FastAPI or async Python application. - Automate bulk document indexing or permission updates using the Indexing API in a scheduled job. - Integrate Glean search into a Python CLI tool or data pipeline for internal knowledge retrieval. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Python SDK for accessing Glean's REST API, providing type-hinted access to both Client and Indexing namespaces with support for synchronous and asynchronous operations. Yes, if you are already using Glean and need Python integration. The package is actively maintained, has low install friction, and provides a well-typed interface to both major Glean API namespaces. However, verify the license terms first—the package metadata does not declare a license, which is a notable gap for production adoption. No known vulnerabilities are recorded. ## Install pip install glean-api-client uv add glean-api-client poetry add glean-api-client ## Installing glean-api-client Before you install: Low friction installation via pip or poetry. The package is actively maintained with a recent release (7 days old) and depends on three well-established libraries: httpx, httpcore, and pydantic. Supports Python 3.10 through 3.14. License in practice: License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms in the repository before adopting this package in proprietary or copyleft-sensitive projects. Quickstart: from glean.api_client import Glean, models import os with Glean(api_token=os.getenv("GLEAN_API_TOKEN", "")) as glean: res = glean.client.chat.create(messages=[ {"fragments": [models.ChatMessageFragment(text="query")]} ]) print(res) Requires Python 3.10 or later. A valid Glean API token and server URL must be provided; different token types are required for Client vs. Indexing API namespaces. Verify before relying: - Whether the package is open-source or proprietary, and under what license terms it is distributed. - Whether the Glean service itself (backend) is self-hosted, SaaS-only, or both. - Rate limits, retry behavior, and timeout defaults beyond what the description mentions. ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 105.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags glean api client python, glean search sdk, glean indexing api, python rest api client, async http client sdk, type-hinted api wrapper, glean enterprise search, api-client, async-support, type-hints [View on SkillFed](https://skillfed.io/packages/glean-api-client) · [View on PyPI](https://pypi.org/project/glean-api-client/)