Skip to main content

MensuraPy is a Python package that provides accurate and user-friendly functions to calculate the area, perimeter, surface area, and volume of 2D and 3D geometric shapes.

Project description


MensuraPy is a Python package that provides accurate and user-friendly functions to calculate the area, perimeter, surface area, and volume of 2D and 3D geometric shapes. Designed for learners, educators, developers, and engineers alike, it makes geometry calculations easy and consistent, supporting multiple units.

🚀 Features

  • Area calculation for 2D shapes like square, rectangle, circle, triangle, ellipse, and more
  • Perimeter calculation for standard 2D and 3D shapes
  • Surface area computation for cubes, cuboids, spheres, cones, cylinders, etc.
  • Volume calculation for 3D shapes with unit consistency
  • Support for multiple units (mm, cm, m, etc.)
  • Built-in exception handling
  • Modular and extensible structure

📦 Installation

pip install mensurapy

🛠 Usage

from mensurapy import area, perimeter, surface_area, volume

print(area("rectangle", "5m", "10m"))           # 50.0 m²
print(perimeter("circle", "7cm"))               # 43.96 cm
print(surface_area("cube", "4m"))               # Total Surface Area: 96.0 m²
print(volume("cylinder", "3m", "10m"))          # 282.74 m³

📚 Supported Shapes

2D Shapes Square, Rectangle, Circle, Triangle, Parallelogram, Trapezium, Ellipse, Rhombus

3D Shapes Cube, Cuboid, Sphere, Cone, Cylinder, Pyramid, Prism, Hemisphere, Ellipsoid

🧪 Testing

To run tests for MensuraPy:

  1. Clone the repository.
  2. Navigate to the project directory
  3. Run the tests using
python -m unittest discover tests

🧠 Why MensuraPy?

MensuraPy provides an easy-to-use solution for calculating measurements in geometry. It's designed with simplicity and efficiency in mind, offering a wide range of functionality to handle various geometric shapes in both 2D and 3D. With MensuraPy, you can easily integrate these calculations into your projects without having to manually handle complex formulas and conversions.

🤝 Contributing

Contributions are welcome! If you'd like to contribute to MensuraPy, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes.
  4. Push your changes to your fork.
  5. Open a pull request to the main repository.

Please ensure your code follows the style guidelines and that tests are added for any new functionality.

📄 License

MensuraPy is released under the MIT License. See the LICENSE file for more information.

Links

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

mensurapy-0.2.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

mensurapy-0.2.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mensurapy-0.2.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for mensurapy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9c150bc76e8379bbac4da550a959600d1e03d7383173c08d44d77f0f68b6d27e
MD5 cfba0331f3fd2ec3c46bedf8838faec2
BLAKE2b-256 61b8ef1a174e009ebd8f7f0a20dd8d83f203a6261fcb4eff4789abed8f14d019

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mensurapy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for mensurapy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09054fdfce9c0b55daaec29d06896d0234aec5660ceda3ab6b545a04c47ac580
MD5 d6f8f892994bf9af216834505977fbdf
BLAKE2b-256 cf3c1ad624f0299d56b5bec1cf9452df63479868c3daaebe8865debc1c83325e

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