truecopy

v2.0.29
io.github.truecopydev/truecopy Checked 6 hours ago Published 1 day ago

Read tables, figures and dates out of a PDF, Word file, CSV or paste, with a verdict on the reading.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

read_table Read a table out of a document

Read a PDF, a CSV, a TSV or a saved paste on this machine into rows, and say what the reading cannot vouch for. Returns the cut into columns, what each column holds, the rows numbered for check_citations, and the doubts. An empty list of doubts is NOT a promise that the reading is right: it means nothing looked wrong from the shape of the page. The file is read on this machine and never uploaded.

ParameterTypeDescription
path *stringAbsolute path to the file on this machine. It is read here and never uploaded.
digeststringThe digest read_table returned for this file. When given, the call is refused if the file has changed since: its rows would no longer be the ones numbered.
fromintegerFirst row to return, 1 for the start. Rows keep these numbers.
limitintegerRows to return, at most 2000. Defaults to 200. What is left is counted and named, never silently dropped.
maximumPagesintegerHow many pages to open. Defaults to 40, which bounds a runaway read rather than describing your document: raise it for an annual report.

find_amounts Find the figures a document prints, with the row to cite

Find every figure written with a given number of decimals in a document on this machine: the value, the characters as printed, and the row and column they sit in, numbered as read_table numbers them. Two decimals is how a page tells a sum of money from a reference number without knowing what money is; ask for 0 decimals to take every number. The answer opens with the verdict of the reading, reliable, doubtful or unreadable, and reliable only means nothing looked wrong. What a figure MEANS - a debit, a balance, a date written as digits - is not read here: that is the reading, and check_citation…

ParameterTypeDescription
path *stringAbsolute path to the file on this machine. It is read here and never uploaded.
decimalsintegerExactly how many decimals a figure must be written with. Defaults to 2. 0 takes every number, reference numbers included.
fromintegerFirst row to look in, 1 for the start. Rows keep the numbers read_table gave them.
limitintegerRows to look in, at most 2000. Defaults to 200. What is left is counted and named, never silently dropped.
maximumPagesintegerHow many pages to open. Defaults to 40, which bounds a runaway read rather than describing your document: raise it for an annual report.

find_dates Find the dates a document prints, with the row to cite

Find every cell that starts with a date in a document on this machine: the calendar date, the characters as printed, and the row and column they sit in, numbered as read_table numbers them. The order of day and month is STATED, never guessed: there is no reading of 01/02/2026 that is right everywhere. A row that prints a day and a month without a year is a date only when the year is given, which is how a statement dates its rows. The answer opens with the verdict of the reading, reliable, doubtful or unreadable, and reliable only means nothing looked wrong. The file is read on this machine and…

ParameterTypeDescription
path *stringAbsolute path to the file on this machine. It is read here and never uploaded.
dateOrderstringWhich of the first two numbers is the day. Defaults to DMY, which is how most of the world outside the United States writes a date.
fromintegerFirst row to look in, 1 for the start. Rows keep the numbers read_table gave them.
limitintegerRows to look in, at most 2000. Defaults to 200. What is left is counted and named, never silently dropped.
maximumPagesintegerHow many pages to open. Defaults to 40, which bounds a runaway read rather than describing your document: raise it for an annual report.
yearintegerThe year a row without one belongs to, stated once at the top of the document. Left out, such a row is not a date.

check_citations Check values against the rows they were read from

Verify that every value really appears in the rows it cites. A model turning cells into records fails one visible way, it misses a record, and one invisible way: it returns a plausible value the document never printed - a town deduced from a postcode, a rounded figure, a recomposed date - which reads exactly like a successful extraction. Each value is looked up in the cited rows and NOWHERE else, so nothing can be produced, only pointed at. A JSON number is checked as a figure, a JSON string as its words in order. Cite the row numbers read_table returned, for the same file and the same maximum…

ParameterTypeDescription
path *stringAbsolute path to the file on this machine. It is read here and never uploaded.
records *arrayThe records read, each citing the rows it came from.
cellsstringjoined (default) reads the cited cells as one text, so a figure the cut split in two is still found, and two cells 12 and 345 also carry 12345. apart reads no number and no word across two cells.
digeststringThe digest read_table returned for this file. When given, the call is refused if the file has changed since: its rows would no longer be the ones numbered.
maximumPagesintegerHow many pages to open. Defaults to 40, which bounds a runaway read rather than describing your document: raise it for an annual report.

verify_values Check what another reader says the document prints

Check values that another reader - a model reading the page image, an extraction API - returned from this document, without reading in its place. Each value is claimed under the label of its row and gets one of three answers. confirmed: a row that label names prints the figure. contradicted: the rows that label names print other figures, and every one of them was read with confidence. not-found: neither - this reading cannot vouch for the value and does not say it is wrong, so check it by eye. A contradiction is only pronounced from cells read surely, which is why a doubtful row answers not-fo…

ParameterTypeDescription
path *stringAbsolute path to the file on this machine. It is read here and never uploaded.
values *arrayThe values the other reader returned.
digeststringThe digest read_table returned for this file. When given, the call is refused if the file has changed since: its rows would no longer be the ones numbered.
maximumPagesintegerHow many pages to open. Defaults to 40, which bounds a runaway read rather than describing your document: raise it for an annual report.
writtenstringThe decimal mark the claimed strings are written with, when it is not the document's: a model asked for JSON writes 1234.5 for a page printing 1 234,5.