The Linear Python library provides easy integration with the Linear API from applications built in Python.
- Python 3.7+
- Required packages (automatically installed):
- requests
- python-dotenv
- strawberry-graphql
- pydantic
- typing-extensions
The package and all its dependencies can be installed via pip:
pip install linear-python
Create/retrieve your personal Linear API Key in the Settings & access
tab in the Linear app, and then initialize the python Linear client:
from linear_python import LinearClient
client = LinearClient("lin_api_***")
You're now ready to use the Linear client! linear-python
currently provides 1-to-1 python functions to some GraphQL queries/mutations that you would call to access the Linear API. Below are a few sample functions you can call.
viewer = client.get_viewer()
issue_data = {
"teamId": "your-team-id",
"title": "New bug report",
"description": "Description of the issue"
}
new_issue = client.create_issue(issue_data)
There is currently a lot of work to do on this library. A lot of Linear API's GraphQL queries/mutations do not have linear-python
functions. Feel free to tweet me @professorragna if you're interested in contributing to this library.
MIT License