Skip to main content

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

  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

Project details


Download files

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

Source Distribution

cecode-0.1.0.tar.gz (90.9 kB view details)

Uploaded Source

Built Distribution

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

cecode-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

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

Hashes for cecode-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dd9da3b0de7106569975728b9fa4ff272c045ec552e4bfe708175850790910da
MD5 dd109068ae4c56a347d85c7826d23820
BLAKE2b-256 1b0964417bf2cfcb6cef2791842bed7d33ce0f71ec4ada626627653df55ec0a5

See more details on using hashes here.

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

Hashes for cecode-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7764c1390b94b6e9b06925e87d7b2a6111c1afa0388a1959961b98933a23ffd0
MD5 41e324c3e0afa1c4d94bcf66d288b6fe
BLAKE2b-256 ccdea78bd5a5464d6dd68eab8511a6df838bcf59923d013ec1403db07273308b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page