Rust API
Read QuickBooks Desktop (.qbw) company files in Rust without QuickBooks or a database server.
TOML
[dependencies]
qbw = "=202611.24.0"Quick start
Rust
use qbw::Company;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let company = Company::open("company.qbw")?;
let accounts = company.accounts()?;
let parts = accounts.named("Sales:Parts").ok_or("account not found")?;
println!("{} ({})", parts.name, parts.account_type);
let as_of: qbw::chrono::NaiveDate = "2024-06-30".parse()?;
let sheet = company.balance_sheet(as_of)?;
println!("Assets: {}", sheet.assets.total);
println!("Net income: {}", sheet.equity.net_income);
Ok(())
}Reference
| Page | Covers |
|---|---|
| Company & Database Access | Opening files, reading raw rows and sa17, company profile, preferences, Money, and date ranges |
| Accounts, Lists & Stock | Chart of accounts, names, items, stock on hand, valuation, open orders, and supporting lists |
| Transactions, Ledger & Links | Querying transactions, reading forms and lines, general ledger postings, registers, and links |
| Reports, Aging & Checks | Financial statements, subledgers, open items, AR/AP aging, overviews, and balance checks |
| Errors & Partial Reads | qbw::Error, MoneyError, LeftOut, Damage, and Problem |
Examples
Runnable examples are in rust/qbw/examples/:
accounts.rs: list active accounts and balances.balance_sheet.rs: compute and print a Balance Sheet.check.rs: compare computed totals against stored balances.customers.rs: list customers with contacts and balances.find.rs: search transactions withTransactionQuery.invoice.rs: inspect an invoice line by line.owed.rs: list open receivables or payables.overview.rs: build a company overview snapshot.register.rs: print an account register.reorder.rs: find items at or below their reorder point.stored_row.rs: read the underlying SQL Anywhere row for a typed record.