Toggle Menu
Prev Up Next

# `langchain_community.document_loaders.yuque`.YuqueLoader

class langchain_community.document_loaders.yuque.YuqueLoader(access_token: str, api_url: str = 'https://www.yuque.com')

  Load documents from Yuque.

  Initialize with Yuque access_token and api_url.

  Parameters

    - access_token (str) – Personal access token - see https://www.yuque.com/settings/tokens.

    - api_url (str) – Yuque API url.

  Attributes

  `headers` |

  Methods

  `__init__`(access_token[, api_url]) | Initialize with Yuque access_token and api_url.
  `alazy_load`() | A lazy loader for Documents.
  `aload`() | Load data into Document objects.
  `get_books`(user_id) |
  `get_document`(book_id, document_id) |
  `get_document_ids`(book_id) |
  `get_documents`() |
  `get_user_id`() |
  `http_get`(url) |
  `lazy_load`() | A lazy loader for Documents.
  `load`() | Load documents from Yuque.
  `load_and_split`([text_splitter]) | Load Documents and split into chunks.
  `parse_document`(document) |
  `parse_document_body`(body) |

  __init__(access_token: str, api_url: str = 'https://www.yuque.com')

    Initialize with Yuque access_token and api_url.

    Parameters

      - access_token (str) – Personal access token - see https://www.yuque.com/settings/tokens.

      - api_url (str) – Yuque API url.

  async alazy_load() → AsyncIterator[Document]

    A lazy loader for Documents.

    Return type

      AsyncIterator[Document]

  async aload() → List[Document]

    Load data into Document objects.

    Return type

      List[Document]

  get_books(user_id: int) → List[Dict]
    Parameters

      user_id (int) –

    Return type

      List[Dict]

  get_document(book_id: int, document_id: int) → Dict
    Parameters

      - book_id (int) –

      - document_id (int) –

    Return type

      Dict

  get_document_ids(book_id: int) → List[int]
    Parameters

      book_id (int) –

    Return type

      List[int]

  get_documents() → Iterator[Document]
    Return type

      Iterator[Document]

  get_user_id() → int
    Return type

      int

  http_get(url: str) → Dict
    Parameters

      url (str) –

    Return type

      Dict

  lazy_load() → Iterator[Document]

    A lazy loader for Documents.

    Return type

      Iterator[Document]

  load() → List[Document]

    Load documents from Yuque.

    Return type

      List[Document]

  load_and_split(text_splitter: Optional[TextSplitter] = None) → List[Document]

    Load Documents and split into chunks. Chunks are returned as Documents.

    Do not override this method. It should be considered to be deprecated!

    Parameters

      text_splitter (Optional[TextSplitter]) – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.

    Returns

      List of Documents.

    Return type

      List[Document]

  parse_document(document: Dict) → Document
    Parameters

      document (Dict) –

    Return type

      Document

  static parse_document_body(body: str) → str
    Parameters

      body (str) –

    Return type

      str

# Examples using YuqueLoader

- yuque.md