Skip to main content

Computational Mechanical Engineering Toolkit

Project description

PyPI License Python

MechLab 🔧📘

MechLab is an open‑source Python library for mechanical engineering computations, designed to provide a unified, modular, and extensible toolkit for students, researchers, and practicing engineers.

It brings together commonly used scientific libraries under a clean, engineering‑focused API for thermodynamics, fluid mechanics, control systems, and numerical analysis.


✨ Features

  • 🔥 Thermodynamics utilities (properties, processes, cycles)
  • 🌊 Fluid mechanics calculations (dimensionless numbers, flow relations)
  • 🎛️ Control systems support
  • 🧮 Symbolic & numerical computation
  • 📐 Unit‑safe calculations (planned)
  • 🧱 Modular structure (easy to extend)

📦 Installation

Install directly from PyPI:

pip install mechlab

Or using Poetry:

poetry add mechlab

🚀 Quick Start

from mechlab.thermodynamics import enthalpy_TP

h = enthalpy_TP(
    fluid="Water",
    T=500,        # Temperature in K
    P=3e6         # Pressure in Pa
)

print(f"Enthalpy: {h:.2f} J/kg")

📂 Package Structure

mechlab/
│
├── thermodynamics/
│   ├── __init__.py
│   ├── properties.py
│   └── cycles.py
│
├── fluid_mechanics/
│   ├── __init__.py
│   └── dimensionless.py
│
├── control_systems/
│   ├── __init__.py
│   └── linear.py
│
├── utils/
│   ├── __init__.py
│   └── constants.py
│
└── __init__.py

🔬 Dependencies

MechLab is built on top of proven scientific libraries:

  • numpy
  • scipy
  • sympy
  • control
  • fluids
  • CoolProp
  • pint
  • matplotlib

These are installed automatically with MechLab.


🧠 Design Philosophy

  • Engineering‑first API (clear variable names, physical meaning)
  • Readable code over premature optimization
  • Modular – each subject area is independent
  • Extensible – easy to add new models & correlations

📈 Roadmap

  • Rankine, Otto, Diesel cycles
  • Pipe flow & heat exchanger modules
  • Full unit‑aware API using Pint
  • Validation against textbook examples
  • Interactive Jupyter examples
  • Documentation website

🧪 Development Setup

Clone the repository:

git clone https://github.com/sewaksunar/mechlab.git
cd mechlab

Install dependencies with Poetry:

poetry install
poetry shell

Run tests:

pytest

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Open a Pull Request

Please follow:

  • PEP‑8 style
  • Clear docstrings
  • Basic tests for new features

📜 License

This project is licensed under the MIT License.


👤 Author

Sewak Sunar Mechanical Engineering Enthusiast & Python Developer


⭐ Acknowledgements

Inspired by mechanical engineering textbooks and the open‑source scientific Python ecosystem.

If you find MechLab useful, please ⭐ the repository on GitHub!

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

mechlab-0.2.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

mechlab-0.2.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file mechlab-0.2.0.tar.gz.

File metadata

  • Download URL: mechlab-0.2.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.2 Windows/11

File hashes

Hashes for mechlab-0.2.0.tar.gz
Algorithm Hash digest
SHA256 032aa138615fb82f8ee4c9daf9f4a2ad9c5a3b2fd7451b9e16e3d0bde5aa4e01
MD5 4a9f05cd15ab090045a356714c48c635
BLAKE2b-256 a161ef301d57e2e7d8d1828d4f9c07561c7705140ee3eb99516138372e4751e3

See more details on using hashes here.

File details

Details for the file mechlab-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mechlab-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.2 Windows/11

File hashes

Hashes for mechlab-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2822ff5072d943fa4104f569d0ea3fc19d91f2b71969f224540ce050179445ea
MD5 f108cae736ddf1ab745b44f82efb6b4e
BLAKE2b-256 e40b23f8eb6f1417caeb6c2952bc799d75af84c988eab57f052571b1be665db8

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