py-concrete-calc
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
Metadata
Release files for py-concrete-calc 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| py_concrete_calc-1.0.1.tar.gz | 15.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_concrete_calc-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.7 kB
Release files / py_concrete_calc-1.0.1.tar.gz
| Download URL | py_concrete_calc-1.0.1.tar.gz |
|---|---|
| Size | 15.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d381fe5bc88bb6dccfacd13ef056f28fa7720a8b43f7727af844e6cf75307d53
|
|
BLAKE2b-256 checksum How to use checksums |
a625d027bec49eb6d6322af62f130471b7a3d11ce8effd4d6205718dd9ec71bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.4
|
Release files / py_concrete_calc-1.0.1-py3-none-any.whl
| Download URL | py_concrete_calc-1.0.1-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9671af578c7057ef7663e11b1bb8509f70bd7c6fccf6ec47e8e1bfbc0bfe560
|
|
BLAKE2b-256 checksum How to use checksums |
947ca04b5ab38397a3714f236fd89ba7a4ba839a6c5e0026a0ddda00d2208ca4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.4
|
Security for py-concrete-calc 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.