跳到主要内容
Trello 是一款基于网络的项目管理和协作工具,允许个人和团队组织和跟踪他们的任务和项目。它提供了一个称为“看板”的可视化界面,用户可以在其中创建列表和卡片来表示他们的任务和活动。
TrelloLoader 允许您从 Trello 看板加载卡片,它是在 py-trello 的基础上实现的。 目前仅支持 api_key/token 方式。
  1. 凭证生成:trello.com/power-ups/admin/
  2. 点击手动生成令牌的链接以获取令牌。
要指定 API 密钥和令牌,您可以设置环境变量 TRELLO_API_KEYTRELLO_TOKEN,也可以直接将 api_keytoken 传递给 from_credentials 便捷构造方法。 此加载器允许您提供看板名称,以将相应的卡片拉取到 Document 对象中。 请注意,在官方文档中,看板的“name”(名称)也称为“title”(标题): support.atlassian.com/trello/docs/changing-a-boards-title-and-description/ 您还可以指定多个加载参数,以包含或移除文档 page_content 属性和元数据中的不同字段。

特性

  • 从 Trello 看板加载卡片。
  • 根据卡片状态(打开或关闭)过滤卡片。
  • 在加载的文档中包含卡片名称、评论和清单。
  • 自定义要包含在文档中的附加元数据字段。
默认情况下,所有卡片字段都会被相应地包含在完整的文本 page_content 和元数据中。
pip install -qU  py-trello beautifulsoup4 lxml
# If you have already set the API key and token using environment variables,
# you can skip this cell and comment out the `api_key` and `token` named arguments
# in the initialization steps below.
from getpass import getpass

API_KEY = getpass()
TOKEN = getpass()
········
········
from langchain_community.document_loaders import TrelloLoader

# Get the open cards from "Awesome Board"
loader = TrelloLoader.from_credentials(
    "Awesome Board",
    api_key=API_KEY,
    token=TOKEN,
    card_filter="open",
)
documents = loader.load()

print(documents[0].page_content)
print(documents[0].metadata)
Review Tech partner pages
Comments:
{'title': 'Review Tech partner pages', 'id': '6475357890dc8d17f73f2dcc', 'url': 'https://trello.com/c/b0OTZwkZ/1-review-tech-partner-pages', 'labels': ['Demand Marketing'], 'list': 'Done', 'closed': False, 'due_date': ''}
# Get all the cards from "Awesome Board" but only include the
# card list(column) as extra metadata.
loader = TrelloLoader.from_credentials(
    "Awesome Board",
    api_key=API_KEY,
    token=TOKEN,
    extra_metadata=("list"),
)
documents = loader.load()

print(documents[0].page_content)
print(documents[0].metadata)
Review Tech partner pages
Comments:
{'title': 'Review Tech partner pages', 'id': '6475357890dc8d17f73f2dcc', 'url': 'https://trello.com/c/b0OTZwkZ/1-review-tech-partner-pages', 'list': 'Done'}
# Get the cards from "Another Board" and exclude the card name,
# checklist and comments from the Document page_content text.
loader = TrelloLoader.from_credentials(
    "test",
    api_key=API_KEY,
    token=TOKEN,
    include_card_name=False,
    include_checklist=False,
    include_comments=False,
)
documents = loader.load()

print("Document: " + documents[0].page_content)
print(documents[0].metadata)

以编程方式连接这些文档到 Claude、VSCode 等,通过 MCP 获取实时答案。
© . This site is unofficial and not affiliated with LangChain, Inc.