Reference
Reference
Returned by: Extract.source, JinkoClient.create_reference_from_doi, JinkoClient.create_reference_from_pdf, JinkoClient.get_reference, JinkoClient.iter_references, JinkoClient.list_references
Also has every member of ProjectItem.
| Member | Kind | Description |
|---|---|---|
bibliography | property | Return bibliography metadata extracted from this reference. |
doi | property | Return this reference's DOI, if available. |
file | property | Return the File object associated with this reference. |
file_content | property | Return the content of the file associated with this reference. Equivalent to Reference.file.content(). |
list_extracts | method | List extracts belonging to this reference. |
iter_extracts | method | Iterate over all extracts belonging to this reference. |
create_extract | method | Create an extract from this reference. |
create_extract_from_pdf_quote | method | Locate a quote in this reference PDF and create an Extract. |
bibliography
Type: dict[str, Any]
Return bibliography metadata extracted from this reference.
doi
Type: str | None
Return this reference's DOI, if available.
file
Type: File
Return the File object associated with this reference.
file_content
Type: bytes
Return the content of the file associated with this reference. Equivalent to Reference.file.content().
list_extracts
list_extracts(
*,
limit: int | None = None,
after: str | None = None,
kind: Literal["Textual", "Rectangular", "Latex", "DataTable"] | None = None,
classification_type: (
Literal["Statement", "Hypothesis", "Data"] | None
) = None,
classification_level: (
Literal["Weak", "Medium", "Strong", "Excellent"] | None
) = None
) -> Page[Extract]
List extracts belonging to this reference.
Use kind or classification filters to narrow the results when needed.
iter_extracts
iter_extracts(
*,
kind: Literal["Textual", "Rectangular", "Latex", "DataTable"] | None = None,
classification_type: (
Literal["Statement", "Hypothesis", "Data"] | None
) = None,
classification_level: (
Literal["Weak", "Medium", "Strong", "Excellent"] | None
) = None
) -> Iterator[Extract]
Iterate over all extracts belonging to this reference.
This follows pagination automatically and yields every matching extract.
create_extract
create_extract(
*,
anchors: Sequence[Mapping[str, Any]],
text: str | None = None,
latex: str | None = None,
mathjs: str | None = None,
data_table: DataTable | str | None = None,
color: (
Literal["Cyan", "Green", "Grey", "Orange", "Pink", "Purple", "Red"]
| None
) = None,
classification_type: (
Literal["Statement", "Hypothesis", "Data"] | None
) = None,
classification_level: (
Literal["Weak", "Medium", "Strong", "Excellent"] | None
) = None,
name: str | None = None,
folder: Folder | str | None = None,
description: str | None = None,
version: str | dict[str, str] | None = None
) -> Extract
Create an extract from this reference.
anchors must be a non-empty sequence of mappings. Each anchor must
provide page, x, y, width, and height.
x and y start from the top-left corner of the page. width and
height extend rightward and downward from that point.
Multiple anchors are typically used for multi-line text selections. For non-text rectangular extracts, only the first anchor is meaningful.
Provide at most one of text, latex, and data_table. Text
creates a textual extract; latex creates a formula extract, with an
optional MathJS expression; and data_table creates an extract linked to
that data table. When all three are omitted, a rectangular extract is
created.
When color is None, the extract color defaults to Green.
When classification_type is provided without a level, the extract is
created as unevaluated. Hypothesis classifications do not support the
Excellent level.
create_extract_from_pdf_quote
create_extract_from_pdf_quote(
quote: str,
*,
page_hints: int | Sequence[int] | None = None,
color: (
Literal["Cyan", "Green", "Grey", "Orange", "Pink", "Purple", "Red"]
| None
) = None,
classification_type: (
Literal["Statement", "Hypothesis", "Data"] | None
) = None,
classification_level: (
Literal["Weak", "Medium", "Strong", "Excellent"] | None
) = None,
kind: Literal["Textual", "Rectangular", "Latex", "DataTable"] | None = None,
text: str | None = None,
latex: str | None = None,
mathjs: str | None = None,
data_table: DataTable | str | None = None,
name: str | None = None,
folder: Folder | str | None = None,
description: str | None = None,
version: str | dict[str, str] | None = None
) -> Extract
Locate a quote in this reference PDF and create an Extract.
Matching tolerates common text-encoding and whitespace differences, attempts
to match mathematical expressions, and can locate quotes interrupted once by
page breaks, tables, or other intervening content.
If multiple locations are equally good matches, a ValueError is raised.
You can restrict the search to one or more 1-based page numbers with
page_hints.
By default, the Extract is textual and uses quote as its text. Provide
text to store different text, latex and optional mathjs for a
formula Extract, or data_table for a DataTable Extract. Pass
kind="Rectangular" to create an Extract without content.
The attached PDF is downloaded, unless the SDK has already cached it.
This feature requires jinko-sdk[pdf] and a
searchable native text layer; it does not perform OCR. Other options behave
as they do for create_extract.