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.1.tar.gz (5.9 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.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mechlab-0.2.1.tar.gz
  • Upload date:
  • Size: 5.9 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.1.tar.gz
Algorithm Hash digest
SHA256 5943e3fb67096d4b9cce2e2bc543eb962025453fee39ee63e0c3f42824d9ca57
MD5 8814e02aa4a9472829c8de6a523c9cf3
BLAKE2b-256 b654a40d10696bfe5cf4678b79d46c07b1dce4c8508658c6cb8932cc945923d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mechlab-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9574722e9a972b0976621664b92ba3bfe4f6f0aa9cffff87c1b2a24feb259c4f
MD5 ebb2a64feb5762d0ed9a60ab466d0223
BLAKE2b-256 3be0c6383f8f1a7afa7a46d576ac7efdc6a700c417d38482f37142975e3ac0e3

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