Pure TypeScript and Python calculation libraries for construction estimating — zero dependencies. Works everywhere.
Built and maintained by BuildVision — AI-powered construction estimating software. Try the live calculators →
npm install @buildvisionai/construction-calculators
# or
yarn add @buildvisionai/construction-calculators
# or
pnpm add @buildvisionai/construction-calculatorspip install buildvision-construction-calculatorsRequires Python 3.9+. No dependencies beyond the standard library.
import {
calculateConcrete,
calculateMarkup,
calculateRoofingCost,
} from '@buildvisionai/construction-calculators';
// Concrete volume for a 20×30 ft slab, 4 inches thick
const slab = calculateConcrete({
shape: 'rectangular',
length: 20,
width: 30,
depth: 4 / 12,
units: 'imperial',
});
console.log(slab.volumeCuYd); // 2.22 cubic yards
console.log(slab.bagsNeeded); // 134 × 60lb bags
// Price it up with markup
const quote = calculateMarkup({ costs: 850, markupPercent: 25 });
console.log(quote.totalWithMarkup); // $1,062.50
console.log(quote.profitMarginPercent); // 20%
// Roofing cost range
const roof = calculateRoofingCost({
roofArea: 2400,
materialType: 'asphalt',
regionMultiplier: 1.0,
pitchMultiplier: 1.1,
storiesMultiplier: 1.0,
includeTearOff: true,
units: 'imperial',
});
console.log(`$${roof.totalLow.toFixed(0)}–$${roof.totalHigh.toFixed(0)}`);from construction_calculators.concrete import ConcreteInput, calculate_concrete
result = calculate_concrete(ConcreteInput(
shape="rectangular",
length=20,
width=20,
depth=0.333,
units="imperial",
))
print(f"Volume: {result.volume_cu_ft:.1f} cu ft ({result.volume_cu_m:.2f} m³)")
print(f"Bags needed: {result.bags_needed}")from construction_calculators.markup import MarkupFromCostInput, calculate_markup
result = calculate_markup(MarkupFromCostInput(costs=15_000, markup_percent=25))
print(f"Sell: ${result.total_with_markup:,.0f}, Margin: {result.profit_margin_percent:.1f}%")| Calculator | Description | Live Demo |
|---|---|---|
| Concrete | Rectangular/circular volume, bags, sand, gravel, water | Concrete Calculator |
| Concrete Slab | Slab volume, 60/80lb bags, ready-mix trucks, rebar | Concrete Slab Calculator |
| Concrete Block | CMU block count, mortar bags, cost estimate | Concrete Block Calculator |
| Retaining Wall | Block courses, backfill volume, drainage, geogrid layers | Retaining Wall Calculator |
| Calculator | Description | Live Demo |
|---|---|---|
| Gravel | Volume, tonnage, 50lb bags, cost | Gravel Calculator |
| Board Foot | Lumber board feet, cubic meters, weight | Board Foot Calculator |
| Insulation | R-value thickness, rolls/bags by insulation type, cost | Insulation Calculator |
| Paver | Paver count + waste, sand bed, gravel base | Paver Calculator |
| Calculator | Description | Live Demo |
|---|---|---|
| Drywall | Sheets, tape rolls, compound buckets, screws | Drywall Calculator |
| Flooring | Planks/boxes, underlayment, transition strips, cost | Flooring Calculator |
| Paint | Gallons, primer, cost range, time estimate | Paint Calculator |
| Calculator | Description | Live Demo |
|---|---|---|
| Roof Materials | Shingle bundles, accessories, bid price, gross margin | Roof Calculator |
| Roofing Cost | Installed cost by material, region, pitch, stories | Roofing Cost Calculator |
| Metal Roof Cost | Metal roof cost + 50-year vs asphalt comparison | Metal Roof Cost Calculator |
| Roof Pitch | Angle, percent, and rafter length from rise/run | Roof Pitch Calculator |
| Calculator | Description | Live Demo |
|---|---|---|
| Square Footage | Multi-room area for rectangle, square, circle shapes | Square Footage Calculator |
| Fence | Posts, rails, pickets, panels, concrete bags, cost | Fence Calculator |
| Stairs | Step count, rise/run, stringer length, angle | Stair Calculator |
| Deck Cost | Boards, joists, posts, footings, railing, installed cost | Deck Cost Calculator |
| Calculator | Description | Live Demo |
|---|---|---|
| Markup | Selling price and profit margin from cost + markup % | Markup Calculator |
| Labor Cost | Total labor cost with payroll burden multiplier | Labor Cost Calculator |
| Hourly Rate | Billable rate from annual expenses + profit margin | Hourly Rate Calculator |
| Net Profit | Projects/month needed to hit annual profit goal | Net Profit Calculator |
| Construction Cost | Line-item cost roll-up by category | Construction Cost Calculator |
| Equipment Depreciation | 4-method schedule: straight-line, DDB, SYD | Equipment Depreciation Calculator |
| Timeline | Critical path method (CPM) — earliest/latest start, float | Timeline Calculator |
All functions accept a units parameter — 'imperial' or 'metric'. Outputs include both unit variants where relevant.
| Package | Registry | Docs |
|---|---|---|
@buildvisionai/construction-calculators |
npm | TypeScript API |
buildvision-construction-calculators |
PyPI | Python API |
- Pure functions — input in, result out, no side effects
- Zero dependencies — nothing to audit, nothing to break
- Fully typed — TypeScript types and Python dataclasses
- Universal — works in Node, browser, Deno, edge runtimes (TS) and Python 3.9+ (Python)
PRs welcome. Good areas to expand: HVAC load, electrical, plumbing, sitework, earthworks.
MIT — see LICENSE.
Built by BuildVision — AI-powered construction estimating software for the modern contractor.