Skip to main content

Functions to calculate geometric properties of 2D and 3D shapes.

Project description

shapes_geometry

shapes_geometry is a lightweight Python package for performing geometry calculations for common 2D and 3D shapes. It provides simple functions to compute area, perimeter, volume, surface area, and other geometric properties — perfect for students, educators, and developers building math-related tools.


Features

  • 2D Shapes: Circle, Triangle, Square, Rectangle, Parallelogram, Rhombus, Trapezium, Kite, Semicircle, Regular Polygons (Pentagon, Hexagon, Octagon, Decagon)
  • 3D Shapes: Sphere, Cube, Cuboid, Cone, Cylinder
  • Simple API with functional structure (no classes)
  • Easy to extend and integrate into other Python projects

📌 Version History

v0.1.5 - Current Version

  • Added utils.validate_positive_numbers() for reusable validation.
  • Added Geometric Calculations for Capsule.

v0.1.4

  • Added utils.validate_positive_numbers() for reusable validation.
  • Applied consistent dimension checks across shapes (circle, cylinder, etc.).
  • Improved exception handling with:
    • ShapesGeometryError
    • InvalidDimensionError
    • InvalidCoordinateError

v0.1.3

  • Added support for more 2D and 3D shapes (parallelogram, trapezium, cone, etc.).
  • Introduced initial exception handling for invalid dimensions.

v0.1.2

  • Implemented core shapes: Circle, Square, Rectangle, Triangle, Cube, Sphere, Cylinder.
  • Added area, perimeter, surface area, and volume functions.

v0.1.1

  • Basic setup with __init__.py.
  • Organized shapes into modules.
  • First working release with Circle and Square.

Installation

pip install shapes-geometry

Example Usage

from shapes_geometry.shapes import circle, square, rectangle

print(circle.area(5))           # Output: 78.53981633974483
print(square.perimeter(4))      # Output: 16
print(rectangle.area(10, 5))    # Output: 50

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

shapes_geometry-0.1.5.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

shapes_geometry-0.1.5-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file shapes_geometry-0.1.5.tar.gz.

File metadata

  • Download URL: shapes_geometry-0.1.5.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for shapes_geometry-0.1.5.tar.gz
Algorithm Hash digest
SHA256 3e430ceb836221c6f248717225ef29ed7397db6ab1ed6ca0a3f0debf9020d6f8
MD5 e1bfb63486f0fee76573f51ef3659139
BLAKE2b-256 cf712570ace0ff5c7a68bc1e0ae9e8d8ee111946a5136ce771fbdc423ce70d3e

See more details on using hashes here.

File details

Details for the file shapes_geometry-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for shapes_geometry-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8f62989ccf330173d5e04a508d047bd31cf12b8ec3ac5d753bad3d151e826902
MD5 249b4a7d29a811631acec3cfe852f3ba
BLAKE2b-256 743ee02a9b1c75debfe32d8dbf3d35a27979d65424304462fea656e6f8580393

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