Skip to main content

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

  1. Clone the repo or download one of the marimo notebooks you're interested in.
  2. 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

Release files for cecode 0.1.0

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

Source distribution (sdist)

Source distribution for cecode 0.1.0
File Size Uploaded
cecode-0.1.0.tar.gz 90.9 kB Details

Built distribution (wheel)

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

Total release size: 103.1 kB

Release files / cecode-0.1.0.tar.gz

Download URL cecode-0.1.0.tar.gz
Size 90.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dd9da3b0de7106569975728b9fa4ff272c045ec552e4bfe708175850790910da
BLAKE2b-256 checksum
How to use checksums
1b0964417bf2cfcb6cef2791842bed7d33ce0f71ec4ada626627653df55ec0a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Release files / cecode-0.1.0-py3-none-any.whl

Download URL cecode-0.1.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7764c1390b94b6e9b06925e87d7b2a6111c1afa0388a1959961b98933a23ffd0
BLAKE2b-256 checksum
How to use checksums
ccdea78bd5a5464d6dd68eab8511a6df838bcf59923d013ec1403db07273308b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Release history Release notifications | RSS feed

This release

0.1.0 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