Linear API Python Client
raw JSON → 0.2.0 verified Fri May 01 auth: no python
A set of Python utilities for calling the Linear API. Current version 0.2.0, supports Python >=3.9. Development is active but the library is still early-stage.
pip install linear-api Common errors
error ModuleNotFoundError: No module named 'linear_api' ↓
cause Installed package 'linear-api' but tried to import 'linear-api' (with hyphen) or haven't installed at all.
fix
Run: pip install linear-api, then import as 'from linear_api import LinearAPI'.
error linear_api.LinearAPI.__init__() got an unexpected keyword argument 'token' ↓
cause Using old parameter name 'token' which was renamed to 'api_key' in v0.2.0.
fix
Use: LinearAPI(api_key='your_key')
Warnings
breaking The API is in early development (v0.x). There may be breaking changes between minor versions without deprecation warnings. ↓
fix Pin to a specific version, e.g., pip install linear-api==0.2.0, and check the changelog before upgrading.
gotcha The module name uses an underscore: linear_api, not linear-api. Importing from 'linear-api' (with a hyphen) will fail. ↓
fix Use 'from linear_api import ...' (underscore).
deprecated The constructor argument 'token' was renamed to 'api_key' in v0.2.0. ↓
fix Use LinearAPI(api_key='...') instead of LinearAPI(token='...').
Imports
- LinearAPI wrong
from linear_api import LinearClientcorrectfrom linear_api import LinearAPI - LinearIssue
from linear_api import LinearIssue
Quickstart
from linear_api import LinearAPI
import os
client = LinearAPI(api_key=os.environ.get('LINEAR_API_KEY', ''))
me = client.viewer()
print(f"Hello {me['name']}")