Skip to main content

PyCBA logo

PyCBA — Python Continuous Beam Analysis

Fast, accurate continuous-beam analysis for the design, assessment and teaching of buildings and bridges —
from linear statics to plastic collapse, modal dynamics and moving-load bridge assessment.

PyPI version Python versions Tests codecov Documentation License: AGPL v3 Code style: black

PyCBA result diagrams

PyCBA is a focused, dependable 1-D continuous-beam engine built on the matrix (direct) stiffness method. It is deliberately not a general 2-D/3-D FE package — instead it does one thing extremely well, with a clean API, light dependencies (numpy / scipy / matplotlib), and an analysis core that powers a surprisingly broad toolkit.

import pycba as cba

# A two-span continuous beam: 10 m + 12 m, EI = 30 000 kN·m², pinned supports
beam = cba.BeamAnalysis(L=[10, 12], EI=30_000, supports=["pin", "pin", "pin"])
beam.add_udl(i_member=1, w=20)         # 20 kN/m on span 1
beam.add_pl(i_member=2, p=50, a=6)     # 50 kN point load at mid-span 2
beam.analyze()

beam.plot_results()                    # bending moment, shear, deflection + reactions
print(beam.at(5.0))                    # -> {'M': 162.5, 'V': -17.5, 'R': 0.0, 'D': -0.05}

✨ What it does

Analysis

  • Continuous beams of any number of spans, with pin / roller / fixed / vertical-spring / rotational-spring supports, prescribed settlements, and internal hinges — plus pre-solve mechanism detection.
  • An element library: Euler–Bernoulli, Timoshenko (shear-deformable), non-prismatic (variable EI), and beam-on-Winkler-foundation.
  • Nonlinear elasto-plastic analysis to collapse (plastic hinges, mechanism detection, collapse-mechanism plots).
  • Free-vibration (modal) analysis — natural frequencies, periods and mode shapes.

Loads & bridges

  • UDL, point, partial, trapezoidal, moment and imposed-curvature (creep / shrinkage / thermal) loads; load cases, combinations and patterned UDLs.
  • Moving-load bridge assessment — influence lines, envelopes, coincident effects, lane UDLs and shear points / critical shear.
  • Code load models — road & rail, from six nations — AASHTO HL-93, Eurocode LM1 / LM71, BS 5400 / CS 454 HB, CSA CL-625, China JTG, AREA Cooper E, AS 5100 M1600 / S1600 / 300LA, NAASRA T44 / MS18 — organised by region.
  • A post-tensioning preprocessor for prestress.

Visualisation

  • Beam & load schematics in matplotlib and publication-quality TikZ / stanli.
  • Shaded bending-moment / shear / deflection diagrams, reaction plots, coincident-effects, mode-shape, collapse-mechanism and vehicle plots.
  • An interactive Plotly backend, and selectable display unit systems (SI / US / N·mm).

Ergonomics

  • Point queries at(x), exports to_dataframe() / to_csv(), a friendly supports= API, and clear errors — all validated against closed-form solutions, with 370+ tests.

📦 Installation

pip install pycba                 # core
pip install "pycba[plotly]"       # + interactive plots

Requires Python 3.9+.

📚 Documentation & tutorials

Full documentation, a Theoretical Basis, and a dozen worked-example notebooks (bridges, foundations, modal, non-prismatic, nonlinear collapse, creep/shrinkage/thermal, the vehicle library, and more) are at ccaprani.github.io/pycba.

🌱 Origins

PyCBA began life as a Python port of Colin Caprani's MATLAB Continuous Beam Analysis program (later ported to C++ by Pierrot). It has since grown well beyond that starting point into the toolkit above — but the spirit is unchanged: fast, exact, and a pleasure to use.

📄 License

PyCBA is released under the GNU Affero General Public License v3.0 (AGPL-3.0). In short: you are free to use PyCBA for any purpose — including professional and commercial work — but if you incorporate it into your own software, or offer it over a network (e.g. a hosted or SaaS tool), that software must in turn be released under the AGPL. Contributions and issues are welcome on GitHub.

Metadata

Release files for PyCBA 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyCBA 1.0.2
File Size Uploaded
pycba-1.0.2.tar.gz 195.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyCBA 1.0.2
File Interpreter ABI Platform
pycba-1.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 349.1 kB

Release files / pycba-1.0.2.tar.gz

Download URL pycba-1.0.2.tar.gz
Size 195.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e8dce2c4861d23b8238ec38b59c7fc8894a797e2e426054f8918dacb1c26e41b
BLAKE2b-256 checksum
How to use checksums
6df47b4489b5d0074edb30ffdbe998a4b9086fc0bb4547347fbf823036272a5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / pycba-1.0.2-py2.py3-none-any.whl

Download URL pycba-1.0.2-py2.py3-none-any.whl
Size 153.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7259c9c19d116b230485f15e6d39805b4f22e6d7179d972d6e59407ad1cce890
BLAKE2b-256 checksum
How to use checksums
e94ed1c50ce4944c2d3675f63a20b8c720e8b218454b3789bcda951d5e4839f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3

2 release files

0.2.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page