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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mechlab-0.2.2.tar.gz
  • Upload date:
  • Size: 5.8 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.2.tar.gz
Algorithm Hash digest
SHA256 b3e08efaa582edca5371a3132d73aafa635251878551d1b926de15b5fef10cdf
MD5 03113598808e10398ca15c7c2cf516aa
BLAKE2b-256 d527fbf0f1b52c395e7065174f579d0413e2eb01aef1741c142383a694d87238

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mechlab-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3c3e7505c84a0c5a76b6bafc2378f4870e4adbe6747e386c49f68772288f7334
MD5 ad99c0ab65ff4755b313bff401515238
BLAKE2b-256 7990325e4cfe411684a9de6645dd975d1b3049d4950c2e23e5d20c7582998406

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