Skip to main content

Concrete volume, bag, material, and cost calculations for construction projects.

Project description

py-concrete-calc

PyPI version License: MIT Built by SlabCalc.co

Concrete volume, bag, material, and cost calculations for construction projects.

A Python library for estimating concrete quantities — from simple slab volumes to full project takeoffs with rebar, wire mesh, formwork, and regional pricing. Built by SlabCalc.co, the free online concrete calculator.


Installation

pip install py-concrete-calc

For pandas DataFrame support:

pip install py-concrete-calc[pandas]

Quick Start

from concrete_calc import estimate, inches_to_feet

# 20 ft × 10 ft slab, 4 inches thick
result = estimate(length=20, width=10, thickness=inches_to_feet(4))

print(f"Volume: {result.cubic_yards} cubic yards")
print(f"80 lb bags needed: {result.bags}")
print(f"Ready-mix cost: ${result.ready_mix_cost_total}")
print(f"Bag cost: ${result.bag_cost_total}")

Full project estimate with materials

from concrete_calc import estimate, inches_to_feet

result = estimate(
    length=20,
    width=10,
    thickness=inches_to_feet(4),
    waste_factor=1.10,       # 10% extra for waste
    include_materials=True,  # adds rebar, wire mesh, forms
    rebar_spacing_in=12,     # 12" on-center
    rebar_bar_size=4,        # #4 rebar
)

print(f"Concrete: {result.cubic_yards} yd³")
print(f"Rebar: {result.rebar['pieces_20ft']} pieces (20 ft bars)")
print(f"Wire mesh: {result.wire_mesh['sheets_5x10']} sheets")
print(f"Form boards: {result.forms['boards_8ft']} boards (8 ft)")

Using the ConcreteCalculator class

from concrete_calc import ConcreteCalculator

calc = ConcreteCalculator()

# Volumes for different shapes
print(calc.slab(20, 10, 0.333))          # rectangular slab
print(calc.cylinder(diameter=2, height=4)) # sonotube column
print(calc.footing(30, 1.5, 1))           # continuous footing
print(calc.stairs(0.75, 1.0, 3.0, 5))     # 5-step staircase
print(calc.wall(20, 8, 0.5))              # concrete wall
print(calc.circular_slab(10, 0.333))       # round pad

Shape Calculators

All shape functions accept dimensions in consistent units (feet or meters) and return volume in cubic units.

Function Description Online Calculator
slab(l, w, t) Rectangular slab Slab Calculator
cylinder(d, h) Round column / sonotube Column Calculator
footing(l, w, d) Continuous footing Footing Calculator
stairs(rise, run, w, n) Staircase Stairs Calculator
curb(l, w, h) Curb / barrier Curb Calculator
wall(l, h, t) Concrete wall Wall Calculator
hollow_cylinder(od, id, h) Hollow column
circular_slab(d, t) Round pad / fire pit
triangular_prism(b, h, l) Ramp / tapered edge
grade_beam(l, w, d, n) Grade beam

Bag Estimation

from concrete_calc import bag_estimate, bags_from_yards

bags = bag_estimate(cubic_feet=27, bag_size=80)  # 45 bags
bags = bags_from_yards(cubic_yards=1, bag_size=60)  # 60 bags

Supports 40, 50, 60, and 80 lb bags. For a visual breakdown, see How Many Bags of Concrete Do I Need?

Cost Estimation

from concrete_calc import ready_mix_cost, bag_cost

# Ready-mix truck delivery
r = ready_mix_cost(cubic_yards=5, price_per_yard=160)
print(f"${r['cost']}")  # $800.00

# Bagged concrete from the hardware store
b = bag_cost(cubic_feet=27, bag_size=80, price_per_bag=6.50)
print(f"{b['bags']} bags = ${b['cost']}")  # 45 bags = $292.50

For current pricing in your area, check the Concrete Cost Calculator.

Regional Pricing Database

from concrete_calc import get_regional_price, list_regions

print(list_regions())
# ['midwest', 'national', 'northeast', 'southeast', 'southwest', 'west']

ne = get_regional_price("northeast")
print(f"Northeast: ${ne['price_per_yard']}/yd³")  # $175.00/yd³

Material Quantities

from concrete_calc import rebar_estimate, wire_mesh_estimate, form_lumber_estimate

# Rebar grid for a 20×10 ft slab
rebar = rebar_estimate(20, 10, spacing_in=12, bar_size=4)
print(f"{rebar['pieces_20ft']} bars, {rebar['weight_lbs']} lbs")

# Welded wire mesh
mesh = wire_mesh_estimate(20, 10)
print(f"{mesh['sheets_5x10']} sheets (5×10 ft)")

# Perimeter forms
forms = form_lumber_estimate(20, 10)
print(f"{forms['boards_8ft']} boards, {forms['stakes']} stakes")

Unit Conversions

from concrete_calc import (
    cubic_feet_to_yards,
    cubic_yards_to_cubic_feet,
    cubic_feet_to_meters,
    cubic_meters_to_yards,
    inches_to_feet,
    cm_to_meters,
)

cubic_feet_to_yards(27)       # 1.0
inches_to_feet(4)             # 0.333...
cm_to_meters(10)              # 0.1

Export Results

from concrete_calc import estimate, inches_to_feet, to_json, to_csv

r = estimate(20, 10, inches_to_feet(4))

# JSON
print(to_json(r))

# CSV (multiple estimates)
projects = [
    estimate(20, 10, inches_to_feet(4)),
    estimate(30, 12, inches_to_feet(6)),
]
print(to_csv(projects))

Pandas Integration

from concrete_calc import estimate, inches_to_feet
from concrete_calc.export import to_dataframe

projects = [
    estimate(20, 10, inches_to_feet(4)),
    estimate(30, 12, inches_to_feet(6)),
    estimate(15, 15, inches_to_feet(4)),
]

df = to_dataframe(projects)
print(df[["cubic_yards", "bags", "ready_mix_cost_total"]])

Jupyter Notebook Example

# Cell 1: Install
# !pip install py-concrete-calc

# Cell 2: Quick slab estimate
from concrete_calc import ConcreteCalculator, inches_to_feet

calc = ConcreteCalculator()

# Garage slab: 24 ft × 24 ft × 4 in
thickness = inches_to_feet(4)
result = calc.estimate(24, 24, thickness, include_materials=True)

print("=== Garage Slab Estimate ===")
print(f"Concrete: {result.cubic_yards} cubic yards")
print(f"80 lb bags: {result.bags}")
print(f"Ready-mix cost: ${result.ready_mix_cost_total:,.2f}")
print(f"Bag cost: ${result.bag_cost_total:,.2f}")
print(f"Rebar (20ft bars): {result.rebar['pieces_20ft']}")
print(f"Wire mesh sheets: {result.wire_mesh['sheets_5x10']}")
print(f"Form boards (8ft): {result.forms['boards_8ft']}")

# Cell 3: Compare multiple projects
from concrete_calc.export import to_dataframe

projects = [
    calc.estimate(10, 10, inches_to_feet(4), include_materials=True),
    calc.estimate(20, 10, inches_to_feet(4), include_materials=True),
    calc.estimate(24, 24, inches_to_feet(4), include_materials=True),
    calc.estimate(30, 30, inches_to_feet(6), include_materials=True),
]

df = to_dataframe(projects)
df.index = ["Small patio", "Walkway", "Garage", "Large slab"]
print(df[["cubic_yards", "bags", "bag_cost_total", "ready_mix_cost_total"]])

Common Projects Reference

Project Typical Size Calculator
Sidewalk 4 ft × 20 ft × 4 in Slab Calculator
Patio 12 ft × 12 ft × 4 in Slab Calculator
Garage floor 24 ft × 24 ft × 4 in Slab Calculator
Driveway 10 ft × 20 ft × 5 in Slab Calculator
Deck footing 12 in dia × 48 in deep Column Calculator
Fence post 8 in dia × 24 in deep Column Calculator
House footing 20 ft × 18 in × 12 in Footing Calculator
Retaining wall 20 ft × 4 ft × 8 in Wall Calculator

API Reference

Full API documentation is available inline via docstrings. Use help(function_name) in Python or your IDE's autocomplete.

For interactive calculators with visual breakdowns, visit SlabCalc.co.

License

MIT — Built by SlabCalc.co

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_concrete_calc-1.0.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_concrete_calc-1.0.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file py_concrete_calc-1.0.0.tar.gz.

File metadata

  • Download URL: py_concrete_calc-1.0.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for py_concrete_calc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 68b7d34383d2c74bbd1ce04abac67ec2fcf86b53dfe6006c850528304f51c44a
MD5 dac723e8b90e365dff5e6027439f3491
BLAKE2b-256 207c94c8fb135f17480dacea5fdf32fe8553aa9f1f4d7b3fcc0ad9c52d8ce869

See more details on using hashes here.

File details

Details for the file py_concrete_calc-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for py_concrete_calc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b64513eab0d9cd4c6239f8d7a4972a130513559ebaff4b4554460c67ceffddb
MD5 1bacbc2c95f411c1ecab26b084c1b530
BLAKE2b-256 f0893d7301f7ac5473e598413b1668fa6bc403c3165933a88581573774c868ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page