Turn recurring text
into structured data.
Your agent turns logs, invoices and reports into a Texomy spec you can read, review and test. Run that spec locally to extract typed data—with predictable results and no per-document AI cost.
brew install texomy/tap/texomyFree for files up to 10 MB · macOS, Linux, Windows · All install options
Microsoft Corporation Fiscal year ended June 30, 2025 For fiscal 2025, Microsoft reported revenue of USD 281.724 billion, compared with USD 245.122 billion in fiscal 2024. The reported year-over-year increase was 15%. Operating income for the company reached USD 128.528 billion in 2025; the corresponding 2024 figure was USD 109.433 billion. The year-over-year change was 17%. Within Intelligent Cloud, revenue rose by USD 18.8 billion, or 21%. Azure and other cloud services recorded revenue growth of 34%, whereas server products revenue fell by 3%. More Personal Computing generated a revenue increase of USD 3.8 billion, or 7%. Gaming revenue grew by USD 2.0 billion, or 9%, while Xbox hardware revenue fell by 25%.
financial-reports.ymlspec
$imports: [ 'values', 'periods', 'metrics' ] $flags: [ CASE_INSENSITIVE ] Entity: Company: $local: Name: $flags: [ -CASE_INSENSITIVE ] $patterns: '[A-Z][\w&''.-]*( [A-Z][\w&''.-]*){0,3}' LegalForm: 'Corporation|Corp\.|Incorporated|Inc\.|Ltd\.?|Limited|plc|AG|SE|N\.V\.|S\.A\.|Holdings|Group' $fields: { name: Name } $patterns: '#{name} ${LegalForm}' Fact: $local: Entity: Name: $flags: [ -CASE_INSENSITIVE ] $patterns: '[A-Z][\w&''-]*( [\w&''-]+){0,4}' Year: '(19|20)\d{2}' Period: Year: $fields: { year: Year } $patterns: '#{year}' When: 'for|in|during' Report: 'reported|posted|recorded|delivered|generated|achieved|booked|saw' Total: 'was|were|reached|totaled|totalled|amounted to|came in at|stood at|of' Direction: Increase: $value: 'increase' $patterns: 'rose|increased|grew|climbed|advanced|jumped|gained|was up|were up|up|higher|increase|growth|rise|gain' Decrease: $value: 'decrease' $patterns: 'fell|declined|decreased|dropped|slipped|contracted|was down|were down|down|lower|decrease|decline|drop|fall|contraction' Change: $value: 'change' $patterns: 'changed|change' Basis: 'year[- ]over[- ]year|year[- ]on[- ]year|YoY|y/y|annual|from a year (earlier|ago)' # The punctuation before a prior figure or a change belongs to the fact, not to them. Link: '[,;.]? ' Prior: $fields: { figure: Figure, period: Period } $patterns: - '(compared (with|to)|versus|vs\.?|up from|down from|from) #{figure}( (in|for) #{period}| a year (earlier|ago)| in the (prior|previous) year)?' - 'the corresponding #{period} figure was #{figure}' Delta: $fields: { direction: Direction, percent: Figure } $patterns: - 'the( reported)?( ${Basis})? #{direction} was #{percent}' - '(an? )?#{direction}( of)? #{percent}( ${Basis})?' Value: $fields: period: 'Period[]' entity: Entity metric: Metric figure: Figure prior: Prior change: Delta $patterns: - '((${When}) #{period}, )?(#{entity} )?${Report} #{metric} of #{figure}( (${When}) #{period})?(${Link}#{change}(${Link}#{prior})?|${Link}#{prior}(${Link}#{change})?)?' - '((${When}) #{period}, )?#{metric}( for the (company|group))?( (${When}) #{period})? ${Total} #{figure}( (${When}) #{period})?(${Link}#{change}(${Link}#{prior})?|${Link}#{prior}(${Link}#{change})?)?' Change: $fields: segment: Entity period: 'Period[]' entity: Entity metric: Metric direction: Direction amount: Figure::Amount percent: Figure level: Figure::Amount $patterns: - '((within|in|at) #{segment}, )?((${When}) #{period}, )?(#{entity} )?#{metric}( (${When}) #{period})? #{direction} (by )?(#{amount}(,? or #{percent})?|#{percent})( ${Basis})?( (${When}) #{period})?( to #{level})?' - '((within|in|at) #{segment}, )?((${When}) #{period}, )?(#{entity} )?${Report} (a |an )?#{metric} #{direction} of (#{amount}(,? or #{percent})?|#{percent})( ${Basis})?( (${When}) #{period})?' - '(#{entity} )?${Report} (a |an )#{percent} #{direction} in #{metric}( (${When}) #{period})?' Guidance: $local: Expect: '(now |continues to |continue to )?(expects?|anticipates?|forecasts?|projects?|guides? to|sees|targets?|is targeting|are targeting)' Revise: Raise: $value: 'raise' $patterns: 'raised|increased|lifted|upgraded|raises' Lower: $value: 'lower' $patterns: 'lowered|cut|reduced|downgraded|lowers' Confirm: $value: 'confirm' $patterns: 'reaffirmed|confirmed|maintained|reiterated|reaffirms|confirms' Outlook: 'guidance|outlook|forecast|target' About: 'about|approximately|around|roughly|at least|up to|in the range of|in a range of' $fields: period: 'Period[]' entity: Entity metric: Metric direction: Direction revision: Revise figure: Figure $patterns: - '((${When}) #{period}, )?(#{entity} )?${Expect} (full[- ]year |annual )?#{metric}( #{direction})?( (${When}) #{period})? (of |to be |at |to reach )?(${About} )?#{figure}( (${When}) #{period})?' - '((${When}) #{period}, )?(#{entity} )?#{revision} its( full[- ]year| annual| #{period})? #{metric}( #{direction})? ${Outlook}( (${When}) #{period})?( (to|of) (${About} )?#{figure})?' - '((${When}) #{period}, )?#{metric}( #{direction})?( (${When}) #{period})? (is|are) (expected|forecast|projected|anticipated) to (be|reach|come in at) (${About} )?#{figure}( (${When}) #{period})?' - '((${When}) #{period}, )?(the )?#{metric}( #{direction})? ${Outlook}( (${When}) #{period})? (is|was|of|remains|calls for) (${About} )?#{figure}'
$ texomy parse report.txt -m financial-reportsA real spec and its real output. Hover any highlighted value to see its type; click it to find it in the tree.
The format repeats. So does the extraction work.
Regular expressions
Fast, but flat. Every format becomes a wall of escapes that only its author can change, and the output is a list of strings with no structure or types.
An LLM on every document
Flexible, but you pay per page, wait per page, and get slightly different answers on the same input. Your data leaves your machine every time.
A script your AI writes
Quick to get and free to run. But each format becomes more code to review, with the rules, conversions and edge cases mixed together, and tests only if someone writes them.
Texomy gives such text what code already has: a language with types, written with the flexibility of AI and run with the guarantees of a compiler.
From a sample to a tested parser, without writing regex by hand
- 01
Show a sample
Show your agent representative text and explain which fields you need.
- 02
Get a readable spec
The agent writes types, fields and patterns in YAML, checks it, and runs it on your sample through the Texomy MCP server.
- 03
Lock it with tests
Expected output lives next to the spec in *.test.yml. texomy test fails the moment behaviour changes.
- 04
Run it everywhere
texomy parse turns every file into typed JSON on your machine, record by record. No model in the loop.
$imports: 'money'
amount after currency:
input: '$120.50'
output:
- !Money { currency: !Currency::USD '$', amount: !Number::Decimal '120.50' }$ texomy test ok tests/money.test.yml (1 cases) PASSED: 1 test files $ texomy parse statements.txt -m money --output money.jsonl 1 records, 1 matched, 2 nodes in 11 ms
Specs, tests and packages are plain files. Keep them in git and run texomy test in CI.
A spec reads like a model of your domain
Types describe what a value is. Fields describe the role it plays. Subtypes such as Currency::USD keep the result precise without extra code.
- Patterns stay small, because types compose:
#{amount}is a field of typeNumber, so it accepts bothNumber::IntegerandNumber::Decimal. Any pattern can also reuse a type directly, as${Number::Integer}. - Overlaps are settled by fixed rules: longest match, then the more specific type.
- Share types across specs with imports and versioned packages.
Currency:
USD: [ 'USD', '\$' ]
EUR: [ 'EUR', '€' ]
Number:
Integer: '\d+'
Decimal: '\d+\.\d+'
Money:
$fields:
currency: Currency
amount: Number
$patterns:
- '#{currency}\s?#{amount}'
- '#{amount}\s?#{currency}'- type: 'Money'
start: 5
end: 12
fields:
currency: { type: 'Currency::USD', start: 5, end: 6, text: '$' }
amount: { type: 'Number::Decimal', start: 6, end: 12, text: '120.50' }
- type: 'Money'
start: 34
end: 40
fields:
currency: { type: 'Currency::EUR', start: 37, end: 40, text: 'EUR' }
amount: { type: 'Number::Integer', start: 34, end: 36, text: '40' }Extend a spec instead of rewriting it
Types form a hierarchy. A subtype inherits from its parent and fits wherever the parent fits, so one new line reaches every pattern that uses the type.
- Subtypes inherit fields, patterns, values and flags. In the invoices example,
Referencedeclares its pattern once, and an order, a task order and a contract each declare only their label. - A field can take a narrower type:
amount: Money::Amountaccepts an amount but not a rate such asUSD 25/hour. - Add
Currency::JPY, and every pattern that referencesCurrencyaccepts yen, in specs that import it too.
Currency: USD: [ 'USD', '\$' ] EUR: [ 'EUR', '€' ] JPY: [ 'JPY', '¥' ] Money: $fields: currency: Currency amount: Number- type: 'InvoiceTotal'
start: 0
end: 13
fields:
total:
type: 'Money'
start: 7
end: 13
fields:
currency: { type: 'Currency::JPY', start: 7, end: 8, text: '¥' }
amount: { type: 'Number::Integer', start: 8, end: 13, text: '18400' }Works on the text you actually have
Each example is a real spec with tests. Open any of them in Studio and change it.
SAMPLE INVOICE Supplier: Bright Steps Learning Co. Address: 48 Maple Avenue, Riverton, RV 20514 Invoice: INV-20241220-014 Issued: 2024-12-20 Services covered: 2024-12-02 through 2024-12-13 Due date: 2025-01-19 Amount payable: USD 3,900.00 Tutoring School Rate Hours Amount Lincoln High USD 25/hour 48 USD 1,200.00 Oak Middle USD 25/hour 36 USD 900.00 Administration School Weekly rate Weeks Amount Lincoln High USD 450/week 2 USD 900.00 Oak Middle USD 450/week 2 USD 900.00 Order reference: PO-552190 Task order: TO-30418 Contract: CN-77215
invoices.ymlspec
# Invoices: the facts an invoice states about itself, each a label and its value, and the rows of its # tables of charges. Slash dates are not read, because their day and month order is not stated. $imports: 'values' $flags: [ CASE_INSENSITIVE ] Invoice: $local: # Between a label and its value: a colon, a number sign, both, or a space. Is: '[ \t]*#?[ \t]*:[ \t]*|[ \t]*#[ \t]*|[ \t]+' # Up to the end of the line. Name: '\S([^\r\n]*\S)?' # A document number: INV-20241219-001, 2025-0042, RE-24/118, 4500123987. Code: $flags: [ -CASE_INSENSITIVE ] $patterns: '[A-Za-z]*[-/]?\d[A-Za-z0-9]*([-/.][A-Za-z0-9]+)*' Till: '[ \t]+(through|thru|to|until|till)[ \t]+|[ \t]*[-–—][ \t]*' Supplier: $local: Label: [ 'Supplier', 'Vendor', 'Seller', 'Contractor', 'From', 'Billed by', '(Service )?provider' ] $fields: { name: Name } # Only after a colon: 'services from 2025-01-01' names no supplier. $patterns: '${Label}[ \t]*:[ \t]*#{name}' $value: '#{name}' Address: $local: Label: [ 'Address', '(Supplier|Remit to|Billing) address' ] $fields: { address: Name } $patterns: '${Label}[ \t]*:[ \t]*#{address}' $value: '#{address}' Id: $local: Label: [ 'Invoice', 'Invoice (number|no\.?|id)', 'Inv\. no\.?' ] $fields: { code: Code } $patterns: '${Label}${Is}#{code}' $value: '#{code}' # A date the invoice states: each kind declares its label. Dates: $flags: [ MULTILINE ] $fields: { date: Date } $patterns: '${Label}${Is}#{date}' $value: '#{date}' Issue: $local: # A bare 'Date' counts only at the start of a line, not in 'Due date' or 'Order date'. Label: [ 'Issued( on)?', 'Issue date', 'Date of issue', 'Invoice date', 'Dated', '^[ \t]*Date' ] Due: $local: Label: [ 'Due date', '(Payment )?due( on| by)?', 'Pay by' ] ServicePeriod: $local: Label: - 'Services covered' - 'Services( rendered| provided| performed)?' - '(Service|Billing|Invoice) period' - 'Period( of service)?' - 'For the period' $fields: { start: Date, end: Date } $patterns: '${Label}${Is}(from[ \t]+)?#{start}${Till}#{end}' $value: { start: '#{start}', end: '#{end}' } # An amount the invoice states: each kind declares its label. Amounts: $fields: { amount: Money::Amount } $patterns: '${Label}${Is}#{amount}' $value: { amount: '#{amount.amount}', currency: '#{amount.currency}' } Subtotal: $local: Label: [ 'Sub-?total' ] Tax: $local: # Sales tax, VAT 20%, Tax (8%) Label: [ '((Sales )?tax|VAT|GST)( \(?\d+(\.\d+)?%\)?)?' ] Payable: $local: Label: - 'Amount (payable|due)' - 'Total( amount)? (payable|due)' - 'Balance due' - 'Please pay' - '(Grand|Invoice) total' - 'Total' # When payment is due, counted in days: Net 30, payable within 30 days. PaymentTerms: $local: { Days: '\d+' } $fields: { days: Days } $patterns: - 'Net ?#{days}' - '(payable |due )?(within|in) #{days} days' $value: '#{days}' # A reference to another document: each kind declares its label. Reference: $fields: { code: Code } $patterns: '${Label}${Is}#{code}' $value: '#{code}' Order: $local: Label: - '(Purchase )?order( reference| ref\.?| number| no\.?)?' - 'P\.?O\.?( number| no\.?)?' TaskOrder: $local: Label: 'Task order( number| no\.?)?' Contract: $local: Label: - 'Contract( reference| ref\.?| number| no\.?)?' - 'Agreement( number| no\.?)?' Other: $local: Label: '((Our|Your|Customer) )?(reference|ref\.?)( number| no\.?)?' # One row of a table of charges. The header names the columns, and a caption above the header, such as # 'Tutoring', names the section of every row. LineItem: $local: Text: '\S([^\r\n]*\S)?' DescriptionHeader: [ 'Description', 'Item', 'Service', 'Product', 'Particulars', 'Details', 'Activity', 'School' ] QuantityHeader: [ 'Qty\.?', 'Quantity', 'Hours', 'Days', 'Weeks', 'Months', 'Units' ] RateHeader: [ 'Rate', '(Hourly|Daily|Weekly|Monthly) rate', 'Unit price', 'Price', 'Unit cost' ] AmountHeader: [ 'Amount', 'Total', 'Line total' ] $fields: section: Text description: Text quantity: Number rate: Money amount: Money::Amount $tables: $caption: section $columns: description: DescriptionHeader quantity: QuantityHeader rate: RateHeader amount: AmountHeader $value: section: '[#{section}]' description: '#{description}' quantity: '[#{quantity}]' rate: '[#{rate.amount}]' per: '[#{rate.per}]' amount: '[#{amount.amount}]' currency: '[#{amount.currency}]'
$ pdftotext invoice.pdf - | texomy parse -m invoicesSAMPLE BANK STATEMENT Cedar Valley Bank Statement period: 9/25/2023-10/22/2023 Account: 004182337 Account holder: Little Oaks Child Care Center Opening balance: $42,316.20 Money deposited: $58,940.75 Money withdrawn: $47,208.31 Closing balance: $54,048.64 Date Description Reference Debit Credit 9/25/23 Check # 3105 214 $1,280.00 9/25/23 Check # 3106 215 $912.45 9/26/23 Northwest Payroll Services 216 $58.20 9/27/23 City Waste Services 217 $126.90 9/28/23 Office Supply Online 218 $342.18 9/29/23 Fresh Foods Market 219 $587.64 10/1/23 Transfer - credit card 220 $1,046.33 10/1/23 State Nutrition Program 221 $3,875.10
bank-statements.ymlspec
# Bank statements: the bank, account, holder and period of a statement, its balance summary and its # transactions. Consumers select nodes by type. # # Transactions come from a table whose header names its columns, where an unsigned amount under Debit or # Credit takes its sign from the column, or from a line whose amounts carry their own sign. Slash dates # are read month first. $imports: [ 'values' ] $flags: [ CASE_INSENSITIVE, MULTILINE ] # The title of a statement, so that 'Your Bank Statement' is not read as a bank named 'Your Bank'. StatementTitle: '(your|our|my|this) (bank |account )?statement' Bank: $flags: [ -CASE_INSENSITIVE ] $local: { Word: "[A-Z][A-Za-z&'-]*" } # Cedar Valley Bank, First Harbor Credit Union, Northwind Savings Bank, Acme Bank, N.A. Named: '(${Word} )+(Bank|Credit Union|Trust Company)(,? N\.A\.)?' # Bank of Northshire BankOf: 'Bank of( the)?( ${Word})+' AccountNumber: $local: Label: [ 'account', 'account number', 'account no\.?', 'account #', 'acct\.?', 'acct\.? #', 'acct\.? no\.?' ] Number: '[A-Za-z0-9*][A-Za-z0-9* -]*[0-9]' $fields: { number: Number } $patterns: '^${Label}:? *#{number} *$' AccountHolder: $local: Label: [ 'account holder', 'account name', 'account owner', 'customer name', 'name on account', 'prepared for' ] Name: '\S([^\r\n]*\S)?' $fields: { name: Name } $patterns: '^${Label}:? +#{name} *$' StatementPeriod: $local: Label: [ 'statement period', 'period', 'statement dates', 'for the period', 'period covered' ] Through: [ '-', '–', 'to', 'through', 'thru' ] $fields: { start: Date, end: Date } $patterns: '${Label}:?( from)? +#{start} *${Through} *#{end}' $value: { start: '#{start}', end: '#{end}' } BalanceFigure: $local: Figure: Opening: $value: 'opening' $patterns: - '(opening|beginning|starting|previous) balance' - 'balance (brought )?forward' Deposits: $value: 'deposits' $patterns: - 'money deposited' - 'money in' - '(total )?deposits( and (other )?(credits|additions))?' - '(total )?credits' - 'paid in' Withdrawals: $value: 'withdrawals' $patterns: - 'money withdrawn' - 'money out' - '(total )?withdrawals( and (other )?(debits|subtractions))?' - '(total )?debits' - 'checks and (other )?debits' - 'paid out' Closing: $value: 'closing' $patterns: - '(closing|ending|new) balance' - 'balance carried forward' Count: '\d+' # spaces, tabs or dot leaders between the label and the amount Leader: '[ \t.]+' $fields: { figure: Figure, date: Date, count: Count, amount: Money } $patterns: '^#{figure}( (on|as of) #{date})?:?( *\(#{count}\))?${Leader}#{amount} *$' $value: figure: '#{figure}' date: '[#{date}]' count: '[#{count}]' amount: '#{amount.amount}' currency: '[#{amount.currency}]' Transaction: $local: Description: '[^\r\n]+?' Reference: '[A-Za-z]*\d[A-Za-z0-9-]*' # spaces or tabs between columns Gap: '[ \t]+' DateHeader: 'Date' DescriptionHeader: [ 'Description', 'Details', 'Particulars' ] ReferenceHeader: [ 'Ref(erence)?', 'Check ?#' ] DebitHeader: [ 'Debit', 'Withdrawals?', 'Money out' ] CreditHeader: [ 'Credit', 'Deposits?', 'Money in' ] AmountHeader: 'Amount' BalanceHeader: 'Balance' $fields: date: Date description: Description reference: Reference debit: Money credit: Money amount: Money balance: Money amounts: { $type: 'Money[]', $separator: '${Gap}' } # A table whose header names its columns: an unsigned amount under Debit or Credit takes its sign # from its column; an amount under Amount carries its own sign. $tables: $columns: date: DateHeader description: DescriptionHeader reference: ReferenceHeader debit: DebitHeader credit: CreditHeader amount: AmountHeader balance: BalanceHeader # A line without such a header: the amounts carry their own sign. $patterns: '^#{date}${Gap}#{description}(${Gap}#{reference})?${Gap}#{amounts}[ \t]*$' $value: date: '#{date}' description: '#{description}' reference: '[#{reference}]' amount: '[-#{debit.amount}][#{credit.amount}][#{amount.amount}][#{amounts.0.amount}]' currency: '[#{debit.currency}][#{credit.currency}][#{amount.currency}][#{amounts.0.currency}]' balance: '[#{balance.amount}][#{amounts.1.amount}]'
$ pdftotext statement.pdf - | texomy parse -m bank-statementsMicrosoft Corporation Fiscal year ended June 30, 2025 For fiscal 2025, Microsoft reported revenue of USD 281.724 billion, compared with USD 245.122 billion in fiscal 2024. The reported year-over-year increase was 15%. Operating income for the company reached USD 128.528 billion in 2025; the corresponding 2024 figure was USD 109.433 billion. The year-over-year change was 17%. Within Intelligent Cloud, revenue rose by USD 18.8 billion, or 21%. Azure and other cloud services recorded revenue growth of 34%, whereas server products revenue fell by 3%. More Personal Computing generated a revenue increase of USD 3.8 billion, or 7%. Gaming revenue grew by USD 2.0 billion, or 9%, while Xbox hardware revenue fell by 25%.
financial-reports.ymlspec
$imports: [ 'values', 'periods', 'metrics' ] $flags: [ CASE_INSENSITIVE ] Entity: Company: $local: Name: $flags: [ -CASE_INSENSITIVE ] $patterns: '[A-Z][\w&''.-]*( [A-Z][\w&''.-]*){0,3}' LegalForm: 'Corporation|Corp\.|Incorporated|Inc\.|Ltd\.?|Limited|plc|AG|SE|N\.V\.|S\.A\.|Holdings|Group' $fields: { name: Name } $patterns: '#{name} ${LegalForm}' Fact: $local: Entity: Name: $flags: [ -CASE_INSENSITIVE ] $patterns: '[A-Z][\w&''-]*( [\w&''-]+){0,4}' Year: '(19|20)\d{2}' Period: Year: $fields: { year: Year } $patterns: '#{year}' When: 'for|in|during' Report: 'reported|posted|recorded|delivered|generated|achieved|booked|saw' Total: 'was|were|reached|totaled|totalled|amounted to|came in at|stood at|of' Direction: Increase: $value: 'increase' $patterns: 'rose|increased|grew|climbed|advanced|jumped|gained|was up|were up|up|higher|increase|growth|rise|gain' Decrease: $value: 'decrease' $patterns: 'fell|declined|decreased|dropped|slipped|contracted|was down|were down|down|lower|decrease|decline|drop|fall|contraction' Change: $value: 'change' $patterns: 'changed|change' Basis: 'year[- ]over[- ]year|year[- ]on[- ]year|YoY|y/y|annual|from a year (earlier|ago)' # The punctuation before a prior figure or a change belongs to the fact, not to them. Link: '[,;.]? ' Prior: $fields: { figure: Figure, period: Period } $patterns: - '(compared (with|to)|versus|vs\.?|up from|down from|from) #{figure}( (in|for) #{period}| a year (earlier|ago)| in the (prior|previous) year)?' - 'the corresponding #{period} figure was #{figure}' Delta: $fields: { direction: Direction, percent: Figure } $patterns: - 'the( reported)?( ${Basis})? #{direction} was #{percent}' - '(an? )?#{direction}( of)? #{percent}( ${Basis})?' Value: $fields: period: 'Period[]' entity: Entity metric: Metric figure: Figure prior: Prior change: Delta $patterns: - '((${When}) #{period}, )?(#{entity} )?${Report} #{metric} of #{figure}( (${When}) #{period})?(${Link}#{change}(${Link}#{prior})?|${Link}#{prior}(${Link}#{change})?)?' - '((${When}) #{period}, )?#{metric}( for the (company|group))?( (${When}) #{period})? ${Total} #{figure}( (${When}) #{period})?(${Link}#{change}(${Link}#{prior})?|${Link}#{prior}(${Link}#{change})?)?' Change: $fields: segment: Entity period: 'Period[]' entity: Entity metric: Metric direction: Direction amount: Figure::Amount percent: Figure level: Figure::Amount $patterns: - '((within|in|at) #{segment}, )?((${When}) #{period}, )?(#{entity} )?#{metric}( (${When}) #{period})? #{direction} (by )?(#{amount}(,? or #{percent})?|#{percent})( ${Basis})?( (${When}) #{period})?( to #{level})?' - '((within|in|at) #{segment}, )?((${When}) #{period}, )?(#{entity} )?${Report} (a |an )?#{metric} #{direction} of (#{amount}(,? or #{percent})?|#{percent})( ${Basis})?( (${When}) #{period})?' - '(#{entity} )?${Report} (a |an )#{percent} #{direction} in #{metric}( (${When}) #{period})?' Guidance: $local: Expect: '(now |continues to |continue to )?(expects?|anticipates?|forecasts?|projects?|guides? to|sees|targets?|is targeting|are targeting)' Revise: Raise: $value: 'raise' $patterns: 'raised|increased|lifted|upgraded|raises' Lower: $value: 'lower' $patterns: 'lowered|cut|reduced|downgraded|lowers' Confirm: $value: 'confirm' $patterns: 'reaffirmed|confirmed|maintained|reiterated|reaffirms|confirms' Outlook: 'guidance|outlook|forecast|target' About: 'about|approximately|around|roughly|at least|up to|in the range of|in a range of' $fields: period: 'Period[]' entity: Entity metric: Metric direction: Direction revision: Revise figure: Figure $patterns: - '((${When}) #{period}, )?(#{entity} )?${Expect} (full[- ]year |annual )?#{metric}( #{direction})?( (${When}) #{period})? (of |to be |at |to reach )?(${About} )?#{figure}( (${When}) #{period})?' - '((${When}) #{period}, )?(#{entity} )?#{revision} its( full[- ]year| annual| #{period})? #{metric}( #{direction})? ${Outlook}( (${When}) #{period})?( (to|of) (${About} )?#{figure})?' - '((${When}) #{period}, )?#{metric}( #{direction})?( (${When}) #{period})? (is|are) (expected|forecast|projected|anticipated) to (be|reach|come in at) (${About} )?#{figure}( (${When}) #{period})?' - '((${When}) #{period}, )?(the )?#{metric}( #{direction})? ${Outlook}( (${When}) #{period})? (is|was|of|remains|calls for) (${About} )?#{figure}'
$ texomy parse report.txt -m financial-reportsBuilt for data you have to trust
Deterministic
The same spec, dependencies and input yield the same tree on the same runtime version. Defined overlap rules resolve conflicts; declaration order breaks remaining ties.
Local, private, free to run
One native binary for macOS, Linux and Windows. Text never leaves your machine, and AI is used once, to write the spec: the next million records cost CPU time, not tokens.
Safe to run
A spec is data, not code. It cannot open files, call the network or install packages, so a spec written by AI is safe to run. Text in a document cannot give it instructions.
Readable and tested
Types, subtypes and named fields read like a domain model. Specs live in your repo with tests and are reviewed in pull requests, like code.
Typed, nested output
Every match is a node with its type, character offsets and fields. Dates, numbers and money come out typed.
Consistent across formats
Every spec uses one language and returns one output shape. The tenth format, written from a different prompt, reads and parses like the first, and shares its types.
Measured on one laptop
10 MB of repeated example text per run, 12 matching worker threads, full JSON output. Apple M3 Pro: 6 performance + 6 efficiency cores. All measurements →
| Text | Input (10 MB) | Found | Output | Time (12 worker threads) | Peak memory |
|---|---|---|---|---|---|
| Addresses in running text | 63,963 paragraphs | 127,926 addresses | 1.11M nodes · 87.9 MB JSON | 0.42 s | 42.0 MiB |
| Invoices | 111,110 paragraphs | 111,110 invoices | 1.33M nodes · 108.5 MB JSON | 0.80 s | 18.6 MiB |
| Financial report sentences | 15,384 paragraphs | 123,072 sentences | 1.38M nodes · 121.6 MB JSON | 0.44 s | 34.9 MiB |
Speed does not scale proportionally with worker count. In a separate check, the same 10 MB log took 0.95 s with 6 worker threads and 0.84 s with 12. How parallelism affects these results →
Write the spec with your agent, or in Studio
In your coding agent
Texomy ships an MCP server in the same binary. Claude Code, Cursor, Copilot and other agents get tools to read the guide, check, test and parse on your machine. Large inputs never pass through the conversation.
claude mcp add texomy -- texomy mcpAdd to ~/.cursor/mcp.json, or the MCP config of your client:
{
"mcpServers": {
"texomy": { "command": "texomy", "args": ["mcp"] }
}
}Add to .vscode/mcp.json in your project:
{
"servers": {
"texomy": { "type": "stdio", "command": "texomy", "args": ["mcp"] }
}
}In Studio
Open a ready-made example or your own spec. Edit it, see every match highlighted with its type, and run the tests. In the browser, or locally with texomy studio.
Try a working spec
Open the invoices example, run it, then change the text or patterns and inspect the typed result.
Online Studio sends specs and input to the Texomy API for parsing. Use the CLI or local Studio for private data.
The trade-off you no longer have to make
| Regex | LLM per document | Script from your AI | Texomy | |
|---|---|---|---|---|
| Typed, nested output | No | Best effort | If coded | Yes |
| Same input, same output | Yes | No | Yes | Yes |
| Runs offline | Yes | Usually not | Yes | Yes |
| Cost per document | None | Tokens | None | None |
| Runs code written by AI | No | No | Yes, with your permissions | No, a spec is data |
| Text in a document can steer it | No | Yes, prompt injection | No | No |
| A change in review | A longer regex | A new prompt | A code diff | Types, fields and expected output |
Detailed comparisons: Texomy vs regex · Texomy vs LLM extraction · Texomy vs Grok patterns · Texomy vs a script from your AI, with the same change made in both
Questions
What is Texomy?
Texomy is a parser for unstructured and semi-structured text. You describe the values you need as types, fields and patterns in a short YAML spec. The texomy CLI turns any text into typed JSON with that spec, on your machine.
Do I need to write the spec myself?
No. Most people let an AI agent write it. Connect Claude Code, Cursor, Copilot or another MCP client with texomy mcp, show it a sample, and it writes, checks and tests the spec. Review and edit the resulting spec in Studio.
How is this different from asking an LLM to extract the data?
The model helps author the spec. After that, parsing is local computation: no model or tokens required, and it works offline. You can review the spec and test it like code.
Why not just ask my AI to write a Python script?
You can, and it also runs locally for free. The difference is review. A spec change names the new type, its fields and their types, and comes with a test that pins the expected output. A script change is code you have to run to understand. See the same change in both.
How fast is it?
10 MB in 0.42–1.30 seconds with 12 matching worker threads on an Apple M3 Pro (6 performance + 6 efficiency cores), depending on the spec. Peak resident memory was 18.6–42.0 MiB in these runs. Speed does not scale proportionally with worker count. These are repeated-example benchmarks; record size and pattern complexity matter. See the measurements.
Does my text leave my machine?
Not with the CLI, the MCP server or local Studio (texomy studio): they parse everything locally. Your coding agent may send samples and tool results to its model provider. Browser Studio at studio.texomy.com runs specs through the Texomy API for parsing; it has no built-in AI generation.
Is it just regex with extra steps?
Regular expressions are the execution layer. On top, Texomy adds types, subtypes that inherit from their parents, named fields, reusable references, imports, deterministic overlap rules, a typed result tree, and tests.
What does it cost?
The current release is free for individuals, education, open source and organizations under 50 people and USD 5 million in revenue, with a limit of 10 MB per input file. Larger organizations need a commercial license. Texomy Pro, for larger files, batch processing and a local HTTP server, is in preparation. Join the waitlist.
Write the spec once. Run it on everything.
Install the CLI, connect your agent, and turn your first sample into typed data in minutes.
brew install texomy/tap/texomy