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

GitHub: https://github.com/Anuva13/MensuraPy/blob/main/README.md PyPI:

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.1.0.tar.gz (15.6 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.1.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mensurapy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f5d305ddfc4ca50c222aa76f540a444b4872556b2946dac8307b55bc173bfd0e
MD5 df61ce706de58877e9a81348c1dd21fa
BLAKE2b-256 2ecb4830c3ea21ecea028471c408c038d4d2e66a86b7d45a6a3e2e9ae429d078

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mensurapy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9ade45ba95acc04bcfd66e1c67d36406522f483d2f89b38de7022c035a99f7f
MD5 e457642dce117b725956f4b685bc0e9f
BLAKE2b-256 ab13452826a4ceda9c1f9792328bc9c59273825cce602c6011e5b666de671e38

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