特雷洛
Trello 是一种基于 Web 的项目管理和协作工具,允许个人和团队组织和跟踪他们的任务和项目。它提供了一个称为“板”的可视化界面,用户可以在其中创建列表和卡片来表示他们的任务和活动。
TrelloLoader 允许您从 Trello 板加载卡,并在 py-trello 之上实现
这目前支持api_key/token只。
-
单击手动令牌生成链接以获取令牌。
要指定 API 密钥和令牌,您可以设置环境变量TRELLO_API_KEY和TRELLO_TOKEN或者你可以传递api_key和token直接进入from_credentials便利构造函数方法。
此加载器允许您提供板名称,以便将相应的卡片拉入 Document 对象。
请注意,板的 “name” 在官方文档中也被称为 “title”:
https://support.atlassian.com/trello/docs/changing-a-boards-title-and-description/
您还可以指定多个加载参数,以包含/删除文档page_content属性和元数据中的不同字段。
特征
- 从 Trello 看板加载卡片。
- 根据卡的状态(打开或关闭)筛选卡。
- 在加载的文档中包括卡名称、注释和清单。
- 自定义要包含在文档中的其他元数据字段。
默认情况下,全文、page_content和元数据都包含所有卡片字段。
%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)