Metadata-Version: 2.4
Name: mechforge
Version: 0.1.0
Summary: MechForge: Next-Generation Mechanical Engineering Python Platform
Author: MechForge Team
License: MIT
Project-URL: Homepage, https://github.com/mechforge/mechforge
Project-URL: Documentation, https://mechforge.readthedocs.io
Project-URL: Repository, https://github.com/mechforge/mechforge
Keywords: mechanical-engineering,structural-analysis,thermodynamics,fluid-mechanics,machine-design,FEA,fatigue,AI,industry-4.0,digital-twin
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Manufacturing
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.10
Requires-Dist: pint>=0.22
Requires-Dist: pandas>=2.0
Requires-Dist: matplotlib>=3.7
Provides-Extra: ai
Requires-Dist: scikit-learn>=1.3; extra == "ai"
Requires-Dist: xgboost>=1.7; extra == "ai"
Requires-Dist: shap>=0.42; extra == "ai"
Requires-Dist: optuna>=3.2; extra == "ai"
Provides-Extra: industry40
Requires-Dist: paho-mqtt>=1.6; extra == "industry40"
Requires-Dist: asyncua>=1.0; extra == "industry40"
Requires-Dist: pymodbus>=3.5; extra == "industry40"
Provides-Extra: viz
Requires-Dist: plotly>=5.15; extra == "viz"
Requires-Dist: pyvista>=0.40; extra == "viz"
Provides-Extra: reports
Requires-Dist: reportlab>=4.0; extra == "reports"
Requires-Dist: python-docx>=0.8; extra == "reports"
Requires-Dist: jinja2>=3.1; extra == "reports"
Requires-Dist: openpyxl>=3.1; extra == "reports"
Provides-Extra: simulation
Requires-Dist: sympy>=1.12; extra == "simulation"
Provides-Extra: api
Requires-Dist: fastapi>=0.100; extra == "api"
Requires-Dist: uvicorn>=0.23; extra == "api"
Provides-Extra: all
Requires-Dist: mechforge[ai,api,industry40,reports,simulation,viz]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: hypothesis>=6.80; extra == "dev"
Requires-Dist: black>=23.7; extra == "dev"
Requires-Dist: ruff>=0.0.280; extra == "dev"
Requires-Dist: mypy>=1.5; extra == "dev"
Requires-Dist: sphinx>=7.0; extra == "dev"
Requires-Dist: myst-parser>=2.0; extra == "dev"
Dynamic: license-file

# MechForge 🔧⚙️

**Next-Generation Mechanical Engineering Python Platform**

*Structural Analysis • Thermodynamics • Fluid Mechanics • Machine Design • Dynamics • Controls • Materials • Manufacturing • AI/ML • Industry 4.0*

---

## Vision

To become the **NumPy/SciPy of mechanical engineering** — the foundational, trusted computational layer that every mechanical engineer, researcher, and industrial developer reaches for by default.

## Features

### Phase 1 — Foundation (Current)
- ✅ **Unit System** — Pint-based, every value carries units (SI, Imperial, mixed)
- ✅ **Materials Database** — 500+ engineering materials with full property sets
- ✅ **Structural Analysis** — Beam analysis, stress transformation, fatigue, fracture mechanics
- ✅ **Machine Design** — Shafts, gears, bearings, bolted joints, springs
- ✅ **Fluids** — Pipe flow, pump systems, compressible flow
- ✅ **Thermal** — Thermodynamic cycles, heat transfer, heat exchangers
- ✅ **Reports** — Auto-generated PDF/Word engineering reports

### Upcoming
- 🔜 Dynamics & Vibration
- 🔜 Controls (PID, state-space)
- 🔜 AI/ML (Predictive maintenance, optimization, anomaly detection)
- 🔜 Industry 4.0 (IoT, OPC-UA, MQTT, Digital Twins)
- 🔜 FEM Solver & Simplified CFD
- 🔜 Manufacturing (GD&T, DFM)

## Quick Start

```bash
pip install mechforge
```

```python
import mechforge as mf

# Every value carries units — no ambiguity
shaft = mf.machine.Shaft(
    length=mf.Q(500, 'mm'),
    torque=mf.Q(200, 'N*m'),
    material=mf.materials.get('AISI 4140'),
)

result = shaft.analyze()
print(result.max_shear_stress.to('MPa'))
print(result.safety_factor)
```

### Fatigue Analysis
```python
from mechforge.structural import FatigueAnalysis
from mechforge.materials import get_material

analysis = FatigueAnalysis(
    material=get_material('AISI 4340'),
    surface_finish='ground',
    loading_type='bending',
    reliability=0.99,
)
life = analysis.predict_life(sigma_max=450, sigma_min=-200)
print(f'Fatigue life: {life.cycles:.2e} cycles')
analysis.plot_goodman_diagram(save='goodman.pdf')
```

### Heat Exchanger
```python
from mechforge.thermal import HeatExchanger

hx = HeatExchanger(
    method='LMTD',
    hot_inlet=mf.Q(150, 'degC'), hot_outlet=mf.Q(90, 'degC'),
    cold_inlet=mf.Q(25, 'degC'), cold_outlet=mf.Q(70, 'degC'),
    U=mf.Q(500, 'W/(m**2*K)'),
    flow_type='counterflow',
)
result = hx.analyze()
print(f'Required area: {result.area.to("m**2"):.2f}')
```

## Standards Compliance

MechForge implements and references major engineering standards:

| Domain | Standards |
|--------|-----------|
| Shafts | ASME B106, DIN 743 |
| Gears | AGMA 2101-D04, ISO 6336 |
| Fasteners | VDI 2230, ASME B1.1 |
| Fatigue | ASME FFS-1, BS 7910 |
| Pressure Vessels | ASME BPVC VIII |
| Piping | ASME B31.1, B31.3 |

## Architecture

```
mechforge/
├── core/          # Units, constants, materials DB, exceptions
├── structural/    # FEA, beam analysis, stress/strain, fatigue
├── thermal/       # Heat transfer, thermodynamic cycles
├── fluids/        # Pipe networks, pump systems, compressible flow
├── machine/       # Gears, shafts, bearings, springs, bolts
├── dynamics/      # Vibration, modal analysis, rotor dynamics
├── manufacturing/ # GD&T, tolerance stack-up, DFM
├── materials/     # Material DB, selection, composites
├── controls/      # PID, state-space, transfer functions
├── pressure/      # ASME VIII vessels, B31.3 piping
├── energy/        # Turbomachinery, renewables
├── ai/            # Predictive, optimization, anomaly, NLP, vision
├── industry40/    # IoT, OPC-UA, MQTT, digital twins
├── simulation/    # FEM, CFD, MBD, Monte Carlo
├── solvers/       # Shared numerical solvers
├── viz/           # 2D/3D visualization
├── standards/     # Code lookups & compliance
├── reports/       # PDF, Word, HTML, Excel reports
├── database/      # SQLite, PostgreSQL, InfluxDB
├── api/           # FastAPI REST layer
└── cli/           # Command-line interface
```

## Development

```bash
git clone https://github.com/mechforge/mechforge.git
cd mechforge
pip install -e ".[dev]"
pytest
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## License

MIT License — Free for everyone.

---

**MechForge — Built by Engineers, for Engineers** 🏗️
