Granola Python Client
A Python client for the Granola API, inspired by the typescript client. This client allows programmatic interaction with Granola's note-taking and meeting management platform. It uses Pydantic for robust data validation and httpx for asynchronous HTTP requests. It can also mimic the official Granola desktop application headers to help bypass "Unsupported client" validation.
Features
- Async operations using
httpxandasyncio. - Runtime data validation and serialization using Pydantic models.
- Automatic token retrieval from local Granola app (macOS only).
- Mimics official client headers.
- Retry mechanism for requests.
- Pagination support for listing resources like documents.
Requirements
- Python 3.13+
uv(for package management, recommended)
Installation
It's recommended to use uv for managing dependencies in a virtual environment.
-
Install
uv: Follow the official instructions: https://github.com/astral-sh/uv#installation# Example for macOS/Linux curl -LsSf https://astral.sh/uv/install.sh | sh
-
Clone the repository (if developing or installing from source):
git clone <repository_url> # Replace with your repo URL cd granola-python-client
-
Create and activate a virtual environment using
uv:uv venv source .venv/bin/activate # macOS/Linux # .venv\Scripts\activate # Windows
-
Install the package and its dependencies using
uv: For regular use:uv pip install -e . # For editable install from local source
For development (including test dependencies):
uv pip install -e ".[dev]"
Or, if published to PyPI in the future:
# uv pip install granola-client
Quick Start
import asyncio
import platform
from granola_client import GranolaClient, ClientOpts, GranolaAuthError, DocumentsResponse
async def main():
client = None
try:
api_token = "your-api-token" # Replace or use macOS auto-retrieval
if platform.system() == "Darwin" and api_token == "your-api-token":
print("Attempting to initialize client with automatic token retrieval (macOS)...")
client = GranolaClient()
else:
if api_token == "your-api-token":
print("Placeholder token detected. Please set a real token or run on macOS for auto-retrieval.")
return
client = GranolaClient(token=api_token)
# Get documents
print("\nRetrieving documents...")
documents_response: DocumentsResponse = await client.get_documents()
if documents_response and documents_response.docs:
print(f"Found {len(documents_response.docs)} documents:")
for doc in documents_response.docs:
print(f" - ID: {doc.document_id}, Title: {doc.title}")
else:
print("No documents found or response was empty.")
except GranolaAuthError as e:
print(f"Authentication Error: {e}")
except Exception as e:
print(f"An error occurred: {e}")
finally:
if client:
await client.close()
if __name__ == "__main__":
asyncio.run(main())
Metadata
Release files for granola-client 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| granola_client-0.4.0.tar.gz | 40.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| granola_client-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 64.0 kB
Release files / granola_client-0.4.0.tar.gz
| Download URL | granola_client-0.4.0.tar.gz |
|---|---|
| Size | 40.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1f558ce34b9d89bd83bb5a7e4c16f0f800ece44bd0b80d96707fac6ea45f3d4
|
|
BLAKE2b-256 checksum How to use checksums |
afa7900a500b918f6818c876e91eb384f5693fea0ac9ad59e876455a27246b90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.
Transparency logRelease files / granola_client-0.4.0-py3-none-any.whl
| Download URL | granola_client-0.4.0-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26daf5ca43877f24f28c2ce12d300488b2e72b2a9dd48169648be293914ca6ce
|
|
BLAKE2b-256 checksum How to use checksums |
b29b6a78d20f4a1c11eef4422e66d9a13742ad52b074ce7e40e39076d890576d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.
Transparency log