Skip to main content

eurocodepy

PyPI version Python 3.12+ License: LGPL v3

A Python library for structural design calculations according to the Eurocode standards. eurocodepy provides composable, engineering-focused building blocks — material databases, load combinations, section utilities, and code-compliant design checks — that you can drop into scripts, notebooks, or larger analysis tools.

Documentation: https://pcachim.github.io/eurocodepy/
Source: https://github.com/pcachim/eurocodepy
PyPI: https://pypi.org/project/eurocodepy/
Changelog: https://github.com/pcachim/eurocodepy/blob/master/CHANGELOG.md


What's included

Material databases

Characteristic and design values are stored in a bundled database and surfaced through typed Python classes. Variable names follow standard Eurocode notation (fck, fyd, E0mean, …) so calculations trace directly back to the clauses that define them.

Material Available grades
Concrete C20/25 · C25/30 · C30/37 · C35/45 · C40/50 · C45/55 · C50/60 · C55/67 · C60/75 · C70/85 · C80/95 · C90/105
Reinforcement B400A/B/C · B500A/B/C · B600A/B/C · B700A/B/C · A400NR · A500NR · A500EL · A400NRSD · A500NRSD
Prestressing steel Y1770 · Y1860 and others
Structural steel S235 · S275 · S355 · S450
Timber (solid) Softwood C14–C50 · Hardwood D18–D70
Timber (engineered) Glulam GL24h–GL32h/c · CLT · LVL
Bolts Grades 4.6 · 5.6 · 6.8 · 8.8 · 10.9

Steel profiles

Standard European hot-rolled profiles are available as named dataclasses exposing all geometric properties (A, Iy, Iz, Wpl_y, it, Iw, …):

  • I-profiles: IPE, HEA, HEB, HEM
  • Hollow sections: CHS (circular), RHS (rectangular), SHS (square)

Eurocode modules

Module Standard Key functionality
ec1 EN 1991 / EN 1990 Load types, force resultants, ULS / SLS / ALS load combinations
ec2 EN 1992-1-1 Concrete & reinforcement materials; ULS beam bending, shear, shell/membrane reinforcement, punching; SLS crack width, creep, shrinkage; fire
ec3 EN 1993-1-1 Steel materials; I, CHS, RHS, SHS profiles; bolted and welded connections
ec5 EN 1995-1-1 Timber materials (solid, glulam, CLT, LVL); kmod; ULS bending & shear; SLS floor vibration
ec7 EN 1997-1 Soil materials; shallow foundation bearing resistance; seismic bearing resistance; active/passive earth pressure coefficients
ec8 EN 1998-1 Elastic and design response spectra; Portuguese and standard CEN national annexes; spectrum plotting and CSV export
utils — Section properties, principal stresses, stress invariants

National Annex support

Portuguese municipal seismic and wind data is bundled and accessible through NationalParams, seismic_get_params, and wind_get_params.


Quick start

import eurocodepy as ec

# ── Concrete (EN 1992) ─────────────────────────────────────────────────────
c = ec.Concrete('C30/37')
print(c.fck, c.fcd, c.Ecm)          # 30 MPa, ~20 MPa, ~32 800 MPa

# ── Reinforcement ──────────────────────────────────────────────────────────
r = ec.Reinforcement('B500B')
print(r.fyk, r.fyd)                  # 500 MPa, ~434.8 MPa

# ── Structural steel (EN 1993) ─────────────────────────────────────────────
steel   = ec.Steel('S355')
profile = ec.ec3.materials.ProfileI('IPE300')
print(steel.fy, profile.A, profile.Iy)

# ── Timber (EN 1995) ───────────────────────────────────────────────────────
from eurocodepy.ec5 import SolidTimber, ServiceClass, LoadDuration
timber = SolidTimber('C24')
kmod   = timber.k_mod(ServiceClass.SC1, LoadDuration.Medium)
print(timber.fmk, kmod)              # 24 MPa, 0.8

# ── Load combinations (EN 1990) ────────────────────────────────────────────
from eurocodepy.ec1 import Load, LoadType, LoadCombinations, CombinationType
combos = LoadCombinations([
    Load('G', LoadType.PERMANENT, gk=10.0),
    Load('Q', LoadType.LIVE,      qk=5.0),
    Load('W', LoadType.WIND,      qk=3.0),
])
for c in combos.get(CombinationType.ULS):
    print(c)

# ── Seismic spectrum (EN 1998, Portuguese NA) ──────────────────────────────
spec = ec.spectrum.get_spectrum_ec8(
    locale='PT', code='PT-1', imp_class='II',
    soil='C', zone='1_2', behaviour=3.0,
)
ec.spectrum.draw_spectrum_ec8(spec, show=True)
ec.spectrum.write_spectrum_ec8(spec, filename='spectrum.csv')

# ── Concrete shear check (EN 1992) ─────────────────────────────────────────
from eurocodepy.ec2.uls.shear import calc_vrdc
VRd_c = calc_vrdc(b_w=300, d=460, As=1608, fck=30)
print(f"VRd,c = {VRd_c/1e3:.1f} kN")

# ── Shallow foundation bearing resistance (EN 1997) ────────────────────────
from eurocodepy.ec7 import bearing_resistance
Rd = bearing_resistance(Bx=1.5, By=2.0, Hx=20, Hy=0, N=200,
                        phi=30.0, gamma=18.0, q=0.0, c=0.0)
print(f"Rd = {Rd:.1f} kN")

# ── Creep coefficient (EN 1992-1-1:2025) ──────────────────────────────────
from eurocodepy.ec2.sls.creep import creep_coef
phi = creep_coef(fck=30, RH=60, h0=200, t0=28, t=18250)
print(f"φ(∞,28) = {phi:.2f}")

Installation

# Stable release from PyPI
pip install eurocodepy

# With uv (recommended)
uv add eurocodepy

# Latest development version from GitHub
pip install git+https://github.com/pcachim/eurocodepy.git

Requires Python ≥ 3.12.


Documentation

Full documentation — API reference, worked tutorials, and how-to guides — is at:

https://pcachim.github.io/eurocodepy/


Contributing

Contributions are welcome. For significant changes please open an issue first to discuss the approach.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m 'feat: add my feature'
  4. Push and open a Pull Request

Please follow the existing code style (enforced by ruff) and include tests where applicable. See CONTRIBUTING_GUIDELINES.md for more detail.


License

GNU Lesser General Public License v3.0 (LGPLv3) — see LICENSE.md and COPYING for the full text.


Disclaimer

This software is intended for educational and research purposes only. It is not a certified engineering tool and must not be used for final structural designs. Always verify calculations against the official Eurocode standards and applicable national annexes, and have final designs reviewed and approved by a qualified structural engineer. The authors assume no liability for design decisions made using this library.

This disclaimer is in addition to, and does not limit, the warranty disclaimer in the LGPLv3 license (see LICENSE.md).


Acknowledgements

Eurocodes and National Annexes are published by CEN and the respective national standards bodies. This project is not affiliated with CEN or any national standards organization.

Metadata

Release files for eurocodepy 2027.0.10

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

Source distribution (sdist)

Source distribution for eurocodepy 2027.0.10
File Size Uploaded
eurocodepy-2027.0.10.tar.gz 482.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eurocodepy 2027.0.10
File Interpreter ABI Platform
eurocodepy-2027.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 925.0 kB

Release files / eurocodepy-2027.0.10.tar.gz

Download URL eurocodepy-2027.0.10.tar.gz
Size 482.8 kB
Tags Source
SHA-256 checksum
How to use checksums
28010205c59df2d20c697e53cc8d3a5e86ff2440383bd307cabc2a52cb14a145
BLAKE2b-256 checksum
How to use checksums
d3301ed83d3debb36148671b6735e2151d84f575285c6fd5d7bd3495ca9619ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / eurocodepy-2027.0.10-py3-none-any.whl

Download URL eurocodepy-2027.0.10-py3-none-any.whl
Size 442.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf14ff305074e77c02abaa125631ef4175bb58aa666403b990b18ce34ebf0b22
BLAKE2b-256 checksum
How to use checksums
d4d79046ddb849f48dcd9992cc52beb8242bf3fa6a59c7cb01f12ef9f43865ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

2027.0.10 This release

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