API Docs

Python

Blue has a Python library that can be used to interact with the Blue API.

We provide a Python library that can be used to interact with the Blue API. This has 100% coverage of the Blue API with type safety and code completion in any modern IDE.

You can install by running:

pip install bluepm

You can then import and use the library in your code:

python
from bluepm import BlueAPIClient

You can set your authentication details either as environment variables

To use environment variables, set the following before running your script:

  • BLUE_TOKEN_ID: Your Blue API token ID
  • BLUE_SECRET_ID: Your Blue API secret ID
  • BLUE_COMPANY_ID: Your Blue company ID (optional)
  • BLUE_PROJECT_ID: Your Blue project ID (optional)

Or, pass them directly to the BlueAPIClient constructor:

python
client = BlueAPIClient(
    token_id="your_token_id",
    secret_id="your_secret_id",
    company_id="your_company_id" #optional
    project_id = "your_project_id" #optional
)

Once you have done this, you can use the library to interact with the Blue API. We have some helpers to simplify common tasks, but the entire API is exposed to allow for any interaction you need.

For example, to get a list of all projects you have access to, you can use the following code:

python
projects = client.projects.list(company_id)

To get a list of lists for a project, you can use the following code:

python
todo_lists = client.get_todo_lists(project_id)