# document.ChunkedDocument


A document with an attached sequence of chunks.


Usage

``` python
document.ChunkedDocument(
    content,
    origin=None,
    attributes=None,
    *,
    chunks,
)
```


This is the chunked variant of [Document](document.Document.md#raghilda.document.Document), the result of running a chunker over a document. It keeps all of the original [Document](document.Document.md#raghilda.document.Document) fields (`content`, `origin`, `attributes`) and adds the `chunks` produced from that content. Stores accept a [ChunkedDocument](document.ChunkedDocument.md#raghilda.document.ChunkedDocument) directly in [upsert()](store.BaseStore.md#raghilda.store.BaseStore.upsert). It is also a sequence: you can iterate over it, take its `len()`, and index into it to reach the underlying chunks.


## Parameters


`chunks: list[Chunk]`  
The chunks produced from this document's content, in document order.


## Methods

| Name | Description |
|----|----|
| [from_any()](#from_any) | Convert any chunked document-like object to a raghilda ChunkedDocument. |

------------------------------------------------------------------------


### from_any()


Convert any chunked document-like object to a raghilda ChunkedDocument.


Usage

``` python
from_any(doc)
```


Use [Document.from_any()](document.Document.md#raghilda.document.Document.from_any) for unchunked inputs.
