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/


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.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

eurocodepy-2027.0.0-py3-none-any.whl (294.8 kB view details)

Uploaded Python 3

File details

Details for the file eurocodepy-2027.0.0-py3-none-any.whl.

File metadata

  • Download URL: eurocodepy-2027.0.0-py3-none-any.whl
  • Upload date:
  • Size: 294.8 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for eurocodepy-2027.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9ca450b445e57ad5a3f904f7155ee2c06dd5a35dd2bc80ee557e0a5db26d4eb
MD5 17f1293d52288ad43568617cd0d949bf
BLAKE2b-256 84f37f9fd1dcd77c07d8a50d2cb89ee1dc34b509b7f0941aa32cde8a8f5f2fb1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2027.0.0 This release

1 file

2026.7.2

2 files

2026.7.1

2 files

2026.4.1

2 files

2026.2.1

2 files

2026.1.3

2 files

2026.1.2

2 files

2026.1.1

2 files

0.1.45

2 files

0.1.44

2 files

0.1.43

2 files

0.1.42

2 files

0.1.39

2 files

0.1.38

2 files

0.1.37

2 files

0.1.36

2 files

0.1.35

2 files

0.1.33

2 files

0.1.32

2 files

0.1.31

2 files

0.1.30

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.19

2 files

0.1.18

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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