Metadata-Version: 2.4
Name: bridge-io
Version: 0.1.1
Summary: An open-source IFC 4.3 to structural engineering analytical and detailed design exporter
Project-URL: Homepage, https://github.com/bridgecopilot/bridge-io
Project-URL: Repository, https://github.com/bridgecopilot/bridge-io.git
Project-URL: Bug Tracker, https://github.com/bridgecopilot/bridge-io/issues
Author-email: Bridge Copilot Operations <ops@bridgecopilot.com>
License-Expression: MPL-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Requires-Dist: click>=8.0.0
Requires-Dist: ifcopenshell>=0.7.0
Provides-Extra: dev
Requires-Dist: black>=22.0.0; extra == 'dev'
Requires-Dist: isort>=5.0.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# bridge-io 🌉

[![PyPI version](https://img.shields.io/pypi/v/bridge-io.svg)](https://pypi.org/project/bridge-io/)
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
[![GitHub workflows](https://github.com/bridgecopilot/bridge-io/actions/workflows/publish.yml/badge.svg)](https://github.com/bridgecopilot/bridge-io/actions)

**bridge-io** is a production-grade, highly extensible open-source Python library designed to act as an interoperability translation layer. It parses bridge models represented in the international building information modeling standard **IFC 4.3 (Industry Foundation Classes for Infrastructure)** and exports them into standard structural engineering analytical and detailed design packages.

## 🚀 The Translation Pipeline

```mermaid
graph LR
    A[IFC 4.3 File] --> B[bridge-io Parser]
    B --> C[In-Memory Spatial Tree]
    C --> D[Target Exporter]
    D --> E[Target Design File]
    
    style A fill:#34495e,stroke:#2c3e50,stroke-width:2px,color:#fff
    style B fill:#3498db,stroke:#2980b9,stroke-width:2px,color:#fff
    style C fill:#2ecc71,stroke:#27ae60,stroke-width:2px,color:#fff
    style D fill:#f39c12,stroke:#d35400,stroke-width:2px,color:#fff
    style E fill:#e74c3c,stroke:#c0392b,stroke-width:2px,color:#fff
```

By reading standard structural alignment curves, deck sections, girder distributions, pier cap geometries, and materials via the `ifcopenshell` framework, `bridge-io` builds a highly cohesive intermediate spatial tree which is then mapped and serialized by specialized exporters.

---

## 🔌 Target Integrations

| Target Software | Exporter Key | Export Format | Status |
|---|---|---|---|
| **CSiBridge** | `csibridge` | `.b2k` / SAP2000 Text Format | **Production** |
| **PGSuper** | `pgsuper` | `.pgt` / XML Project Template | **Production** |
| **Bentley OpenBridge** | `openbridge` | `.xml` / `.landxml` LandXML Schema | **Production** |
| **midas Civil** | `midas` | `.mxt` Midas Exchange Command File | **Production** |
| **STAAD.Pro** | `staad` | `.std` STAAD Structural Commands | **Production** |
| **LUSAS** | `lusas` | `.cmd` LUSAS CMD Automation Script | **Production** |
| **LARSA 4D** | `larsa4d` | `.csv` / `.txt` Copy-Paste Data & COM Script | **Production** |

---

## 📦 Installation

To install `bridge-io` from PyPI, run:

```bash
pip install bridge-io
```

Alternatively, to install from source using Poetry or Hatch:

```bash
git clone https://github.com/bridgecopilot/bridge-io.git
cd bridge-io
pip install .
```

---

## 💻 Programmatic API Usage

Translate models programmatically using Python:

```python
from bridge_io import IFCParser, get_exporter

# 1. Parse your IFC 4.3 infrastructure file
parser = IFCParser()
bridge_def = parser.parse("my_bridge_model.ifc")

print(f"Parsed Bridge: {bridge_def.name}")
print(f"Total Spans count: {len(bridge_def.spans)}")

# 2. Re-route structural parameters to PGSuper XML templates
pgsuper_exporter = get_exporter("pgsuper")
pgsuper_exporter.export(bridge_def, "outputs/pgsuper_model.pgt")

# 3. Export to analytical CSiBridge B2K command file
csibridge_exporter = get_exporter("csibridge")
csibridge_exporter.export(bridge_def, "outputs/csibridge_model.b2k")
```

---

## 🛠️ CLI Usage

`bridge-io` includes a rich command-line interface for batch processing and automated translation pipelines:

```bash
# List all registered exporters and their target extensions
bridge-io list

# Translate an IFC 4.3 model to CSiBridge B2K
bridge-io translate input_bridge.ifc --target csibridge --output translated_model.b2k

# Translate an IFC 4.3 model to PGSuper XML
bridge-io translate input_bridge.ifc -t pgsuper
```

---

## 🤝 Extensibility & Contributions

`bridge-io` was architected with a developer-first mindset. If you wish to write and register a new exporter for a structural package not listed here (e.g. **Ansys APDL**, **Abaqus**, **Autodesk Robot**, or **SAP2000**), please consult our [CONTRIBUTING.md](CONTRIBUTING.md) manual. 

We highly encourage engineering firms and BIM developers to showcase their custom translators by contributing upstream!

---

## 📄 License

This project is licensed under the **Mozilla Public License 2.0 (MPL 2.0)** - see the [LICENSE](LICENSE) file for details.
ops@bridgecopilot.com
