Skip to main content

useful tools for civil engineering that are needed regularly in the daily tasks for a civil engineer

Project description

civix

Python tools for civil and structural engineering.

civix is a flat collection of domain modules for day-to-day structural work — code-based design checks, BIM/model interop, and calc-sheet reporting. Design functions are pure and return typed result dataclasses that carry their own demand/capacity ratio and pass/fail verdict, so a calculation is auditable end to end.

What's inside

Module Purpose
civix.aci318_25 ACI 318-25 structural design checks — beams, columns, foundations, retaining_walls; pure functions returning result dataclasses
civix.materials Concrete and Rebar material objects + named presets (C25C50, GRADE280/GRADE420/GRADE520)
civix.sections Cross-section geometry (Rect/Circle) + bundled steel section database: aisc.shape(...), euro.section(...)
civix.design Shared result plumbing: CalculationReport aggregator, CheckResultMixin, Check protocol
civix.loads Load combination generation
civix.etabs ETABS .NET API automation via pythonnet (Windows)
civix.ifc IFC model querying via ifcopenshell
civix.geom Geometry helpers; reads/writes Rhino .3dm (rhino3dm)
civix.gh Grasshopper snippet helpers
civix.report Quarto CLI wrapper: render .qmd/.ipynb to PDF/HTML
civix.notebook Display helpers (show_check/show_report/calc_block) for Jupyter
civix.core Config, logging, errors, paths

Units are carried in variable names (fck_MPa, As_mm2, Mu_kNm); design functions accept engineer-natural units (kN·m, kN, kPa) at the boundary and compute in N·mm internally.

Installation

pip install civix                      # core only (numpy, loguru, pyyaml, plotly, openpyxl)
pip install "civix[etabs]"             # + ETABS automation (Windows)
pip install "civix[ifc]"               # + IFC parsing (ifcopenshell)
pip install "civix[geom]"              # + Rhino/Grasshopper geometry
pip install "civix[notebook]"          # + Jupyter notebook + handcalcs rendering
pip install "civix[streamlit]"         # + Streamlit app
pip install "civix[all]"               # everything

With uv:

uv add civix
uv add "civix[etabs,ifc,geom]"
uv add "civix[all]"

Quickstart

from civix.aci318_25.beams import flexure
from civix.materials import C30, GRADE420
from civix.sections import Rect

# Singly-reinforced RC beam flexure (ACI 318-25)
res = flexure(
    Rect(b_mm=300, h_mm=600),
    C30,
    GRADE420,
    d_mm=540,
    As_mm2=1500,
    Mu_kNm=220.0,
)
print(f"phiMn = {res.phiMn_kNm:.1f} kN·m  DCR = {res.dcr:.3f}  "
      f"{'PASS' if res.passed else 'FAIL'}  ({res.code_ref})")

In a notebook, render the verdict as a card:

from civix.notebook import show_check
show_check("Beam B1 — flexure", res)

Look up standard steel sections by designation (case/space-insensitive). AISC shapes carry dual US + SI values; European sections are metric:

from civix.sections import aisc, euro

w = aisc.shape("W14X90")        # AISC Shapes Database v15.0
print(w.A_in2, w.A_mm2, w.Ix_in4)        # 26.5  17100.0  999.0

ipe = euro.section("IPE 300")   # EN / ArcelorMittal
print(ipe.h, ipe.b, ipe.Iy)              # 300.0  150.0  8356.0

aisc.UNITS["Ix_mm4"]            # "10^6 mm^4"  — each field's unit

Check your environment and optional runtimes (real load-and-one-operation smoke checks):

civix-health          # dependency + environment check
civix-init-config     # write a default civix.yaml to the current directory

Logging

civix is silent by default — it calls logger.disable("civix") at import and never attaches a sink itself. To see its logs, opt in from your notebook or script:

import sys
from loguru import logger

logger.enable("civix")
logger.remove()
logger.add(sys.stderr, level="INFO")

Streamlit app

uv run streamlit run streamlit_app/app.py

Documentation

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

civix-0.0.26.tar.gz (273.9 kB view details)

Uploaded Source

Built Distribution

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

civix-0.0.26-py3-none-any.whl (294.1 kB view details)

Uploaded Python 3

File details

Details for the file civix-0.0.26.tar.gz.

File metadata

  • Download URL: civix-0.0.26.tar.gz
  • Upload date:
  • Size: 273.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for civix-0.0.26.tar.gz
Algorithm Hash digest
SHA256 093170afbad746e292ebf442548fbd78eda33603736a0841458e4a086b937bf4
MD5 4149ec905a670f5f2557a72f0a9e976a
BLAKE2b-256 1b6667834e6446f707cf7d18787cba3b6d4bde631d54f4e97afe7d338b9b27fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for civix-0.0.26.tar.gz:

Publisher: release.yml on mohamadalitellawi/civix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file civix-0.0.26-py3-none-any.whl.

File metadata

  • Download URL: civix-0.0.26-py3-none-any.whl
  • Upload date:
  • Size: 294.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for civix-0.0.26-py3-none-any.whl
Algorithm Hash digest
SHA256 33cc552d7b5b228913dd07e2313a2c647c8e0957b3e2b147def0f2c2c8477662
MD5 7f1115832bc1afa9793db9ff8bb53c3b
BLAKE2b-256 9dea0cc9f7581bc37fa625d7f638ceaeceb6d4c8fa88c2781e42ffa155e69c39

See more details on using hashes here.

Provenance

The following attestation bundles were made for civix-0.0.26-py3-none-any.whl:

Publisher: release.yml on mohamadalitellawi/civix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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