Trello
Trello is a web-based project management and collaboration tool that allows individuals and teams to organize and track their tasks and projects. It provides a visual interface known as a "board" where users can create lists and cards to represent their tasks and activities.
TrelloLoader 允许您从 Trello 看板加载卡片,其实现基于 py-trello
目前仅支持 api_key/token。
-
点击手动生成令牌链接以获取令牌。
要指定 API 密钥和令牌,您可以设置环境变量 TRELLO_API_KEY 和 TRELLO_TOKEN,也可以直接将 api_key 和 token 传递给 from_credentials 便捷构造函数方法。
此加载器允许您提供看板名称,以将对应的卡片载入文档对象中。
请注意,在官方文档中,board 的"name"也被称为"title":
https://support.atlassian.com/trello/docs/changing-a-boards-title-and-description/
您还可以指定多个加载参数,以从文档的 page_content 属性和元数据中包含或移除不同的字段。
特性
- 从 Trello 看板加载卡片。
- 根据状态(开启或关闭)筛选卡片。
- 在加载的文档中包含卡片名称、评论和检查清单。
- 自定义要包含在文档中的其他元数据字段。
默认情况下,所有卡片字段均包含在全文 page_content 及相应的 metadata 中。
%pip install --upgrade --quiet 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)
API 参考:TrelloLoader
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)