aeclib: Building Code Compliance Library
Open-source automated code compliance building codes and standards.
aeclib translates building code provisions into executable and testable logic.
Installation
pip install aeclib
Intent
The goal of aeclib is to provide a unified "Logic Layer" for the AEC industry to support automated compliance and computational design.
Usage
aeclib is designed as a Stateless Logic Layer. It provides the atomic building blocks of architectural compliance without dictating a specific data schema.
Atomic Logic
Each function in aeclib maps to a specific engineering or code requirement. You are responsible for mapping your own data (JSON, BIM, or Database) to the function's parameters.
Compositional Compliance
The library is designed to be composed into your own application logic. Below is an example of how a user might bring their own JSON design data and map it to a custom Python class to run a specific chapter's compliance check:
{
"space_id": "RM-101",
"function_type": "business",
"gross_area": 1500.0,
"net_area": 1200.0,
"design_occupancy_count": 12
}
from aeclib.occupancy import validate_occupant_load_without_fixed_seating, validate_increased_occupant_load
class OccupancyValidator:
def check_space_occupancy(self, data: dict):
# 1. Check required minimum occupant load (Section 1004.5)
is_load_valid = validate_occupant_load_without_fixed_seating(
function_type=data["function_type"],
gross_area=data["gross_area"],
net_area=data["net_area"],
design_occupancy_count=data["design_occupancy_count"]
)
# 2. Check maximum density limit (Section 1004.5.1)
is_density_valid = validate_increased_occupant_load(
area=data["gross_area"],
occupant_count=data["design_occupancy_count"]
)
return is_load_valid and is_density_valid
Expected Output
When a design fact fails to comply, the library will return FAIL and log a detailed warning:
WARNING:aeclib:[FAIL] Design occupancy (35) is less than required minimum of 40 for educational_classroom (net area: 800.0, factor: 20).
When a design is compliant, the function returns PASS.
License
Licensed under the Apache License 2.0.
Stay Updated
You can get project updates on the architecture and design decisions behind aeclib on Substack.
Metadata
Release files for aeclib 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aeclib-0.3.0.tar.gz | 33.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aeclib-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.1 kB
Release files / aeclib-0.3.0.tar.gz
| Download URL | aeclib-0.3.0.tar.gz |
|---|---|
| Size | 33.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0d41af630e86975c7dec9d409ac5aadcd51f537b192a03640d54f6bffdc404b
|
|
BLAKE2b-256 checksum How to use checksums |
26a8ef5c161e878f642b6ff91f4fa636a980021701b310f2f86a3a2d73db4778
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / aeclib-0.3.0-py3-none-any.whl
| Download URL | aeclib-0.3.0-py3-none-any.whl |
|---|---|
| Size | 44.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14f04d24afcecedb8542360f8986d21116fe95835e672794cabe9c7dbf8b6dca
|
|
BLAKE2b-256 checksum How to use checksums |
ce39b0fdfca0bf036aaf578e7eae48de67b1ca01949cb40cb86304f6d04f5bb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|