Civil Engineering Codes in readable, usable, executable Python.
Project description
cecode
Civil Engineering Codes in Readable, Usable, Executable Python
cecode is a Python library that implements civil engineering standards and codes of practice as structured, interactive marimo notebooks.
It enables engineers to:
- Perform calculations as described in codes like the Eurocode using real code-compliant formulas.
- Understand how results are derived via clear, documented, step-by-step notebooks.
- Automate engineering workflows while retaining traceability to the source standards.
Designed for engineers who need transparency and repeatabilityโnot just black-box results.
๐ฆ Whatโs Inside
- ๐ป Python-first code that reflects the logic of engineering standards
- ๐ Marimo notebooks that combine inputs, explanations, formulas, and results
- โ๏ธ Executable modules usable in automation pipelines or standalone analysis
- ๐ Mapping of inputs and variables to code clauses, descriptions, units, and LaTeX symbols
๐งฑ Why cecode?
Civil engineering standards often describe calculations in written prose, diagrams, or formulae that must be manually translated into code. cecode bridges this gap by:
- Replicating the logic of the code in precise Python
- Making inputs explicit, with documented symbols, units, and meaning
- Rendering results transparently in a visual notebook interface
- Allowing batch or automated use, via the same functions used in notebooks
This makes it possible to write automated engineering tools while still complying with the original design intent of the code of practice that underpins the design.
๐ Getting Started
- Clone the repo or download one of the marimo notebooks you're interested in.
- Run the notebook with:
uvx marimo edit --sandbox path/to/cecode_marimo_notebook.py
๐ Proposed Project Structure
cecode/ # Project root
โ
โโโ src/ # Source directory (standard for modern Python packaging)
โ โโโ cecode/ # `cecode` Python package
โ โ
โ โโโ eurocode_1_1/ # Actions on structures (EN 1991-1)
โ โ โโโ defs.py # Variable definitions for Eurocode 1-1
โ โ โโโ clause_2_3_imposed_loads.py
โ โ โโโ ...
โ โ
โ โโโ eurocode_2_1/ # Structural concrete (EN 1992-1)
โ โ โโโ defs.py # Variable definitions for Eurocode 2-1
โ โ โโโ clause_3_1_design_strength.py
โ โ โโโ ...
โ โ
โ โโโ eurocode_3_1/ # Steel design (EN 1993-1)
โ โ โโโ defs.py # Variable definitions for Eurocode 3-1
โ โ โโโ clause_6_2_buckling_resistance.py
โ โ โโโ ...
โ โ
โ โโโ eurocode_7_1/ # Geotechnical design (EN 1997-1)
โ โ โโโ defs.py # Variable definitions for Eurocode 7-1
โ โ โโโ clause_6_5_bearing_resistance.py
โ โ โโโ clause_7_8_pile_design.py
โ โ โโโ ...
โ โ
โ โโโ bs_8004/ # British Standard: Foundations
โ โ โโโ defs.py
โ โ โโโ section_7_shallow_foundations.py
โ โ โโโ ...
โ โ
โ โโโ ciria_c580/ # CIRIA C580: Embedded retaining walls
โ โ โโโ defs.py
โ โ โโโ section_4_wall_design.py
โ โ โโโ ...
โ โ
โ โโโ aashto_lrfd/ # AASHTO LRFD Bridge Design (USA)
โ โ โโโ defs.py
โ โ โโโ ...
โ โ
โ โโโ ...
โ
โโโ tests/ # Unit tests and verification against worked examples
โ โโโ test_clause_6_5_bearing_resistance.py
โ โโโ ...
โ
โโโ pyproject.toml # Project metadata and build config
โโโ README.md # Project overview
โ๏ธ Contributing
If you'd like to add more clauses, improve notebook clarity, or expand coverage to other codes:
- Fork the repo
- Write clean, readable Python and nicely formatted marimo notebooks
- Document inputs, intermediate variables and results clearly (symbol, units, description, bounds)
- Match the logic of the source standard, clause by clause
- Open a PR and reference the standard clauses you implemented
๐ License
This project is licensed under the Apache 2.0 License. See LICENSE for details.
Note: The actual texts of (most or all?) civil engineering codes (like the Eurocode) are copyrighted and not included in this repository.
๐ท Maintainers
- @bedrock-engineer
- You?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cecode-0.1.0.tar.gz.
File metadata
- Download URL: cecode-0.1.0.tar.gz
- Upload date:
- Size: 90.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd9da3b0de7106569975728b9fa4ff272c045ec552e4bfe708175850790910da
|
|
| MD5 |
dd109068ae4c56a347d85c7826d23820
|
|
| BLAKE2b-256 |
1b0964417bf2cfcb6cef2791842bed7d33ce0f71ec4ada626627653df55ec0a5
|
File details
Details for the file cecode-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cecode-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7764c1390b94b6e9b06925e87d7b2a6111c1afa0388a1959961b98933a23ffd0
|
|
| MD5 |
41e324c3e0afa1c4d94bcf66d288b6fe
|
|
| BLAKE2b-256 |
ccdea78bd5a5464d6dd68eab8511a6df838bcf59923d013ec1403db07273308b
|