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.0.1.tar.gz (5.3 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.0.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mechlab-0.0.1.tar.gz
  • Upload date:
  • Size: 5.3 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.0.1.tar.gz
Algorithm Hash digest
SHA256 952d207e0d9f7d2e482c94a51b03206bea11f4ca1f5cfcdf7a704bd6154f6da5
MD5 25a802c7aa3539dcb0abc7641128a125
BLAKE2b-256 1cbc516177f00ddc855ad064708be5deef5cfac1e2ad1615cf5c9f8ae280ece3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mechlab-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3ee76a737500c55e15d25df30102ddf850ad3c9dafb35fe83f96c8fd34ca2b8
MD5 be23f30bdfbea05fb7f8a1c15294ba84
BLAKE2b-256 9d981b98f4d687719e061e14f8d1270975738fb4037024d9e5ba10fdd3e3344f

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