Skip to main content

Library to manage different inventories

Project description

Inventory management library

This is an inventory management system built using Python's object-oriented programming principles. The system is designed to manage various types of inventories, such as books, movies, groceries, clothing, and electronics, each with custom attributes. This project structure supports scalability and data integrity through custom exceptions and specialized inventory classes for each product type.

Index

  1. Installation
  2. Documentation
  3. Features
  4. Examples
  5. Contributing

Installation

To install this project, clone the repository and install any necessary dependencies.

git clone https://github.com/username/inventory-management.git

Documentation

This project uses Sphinx with the Read the Docs theme to generate and manage project documentation. This section explains how to set up, configure, and generate documentation, making it easier for contributors and users to understand and navigate the project.

Setting Up Documentation

1. Install Requirements

Ensure that Sphinx and the sphinx_rtd_theme are installed by running:

pip install -r requirements.txt

2. Initialize Sphinx

In the root of the project directory, initialize Sphinx by running:

sphinx-quickstart

3. Configure Sphinx Theme

In the docs/conf.py file, set up the Read the Docs theme by adding or modifying the following line:

html_theme = "sphinx_rtd_theme"

4. Generate Documentation

After adding docstrings to your code (as shown in the class and method definitions), generate the HTML documentation by running:

cd docs
make html

This will create an html folder inside docs/_build/, containing the generated documentation.

5. View Documentation

Open the index.html file in the docs/_build/html/ directory to view the documentation in your browser.

Features

  • Flexible Product Types: Includes different types of products, each with specific attributes, such as books, movies, groceries, clothing, and electronics.
  • Specialized Inventory Types: Supports libraries, movie rental stores, grocery stores, clothing stores, electronics shops, and online stores.
  • Custom Exception Handling: Ensures data integrity by raising specific errors, such as invalid quantity values or mismatched product types.
  • Extensibility: Designed to be easily extended to support new product and inventory types.

Usage

Product Types The system includes the following product types, each inheriting from the base Product class and featuring unique attributes:

  • Book: Represents books with attributes author and isbn.
  • Movie: Represents movies with attributes director and rating.
  • Food: Represents food items with an expiration_date.
  • Clothing: Represents clothing items with attributes size, color, and material.
  • Electronics: Represents electronic items with brand and warranty.

Each product class has a total_value method to calculate the total stock value and a str method to display its details.

Inventory Types The following inventory types are available, each managing a specific product type:

  • Library: Manages Book products.
  • MovieRentalStore: Manages Movie products.
  • GroceryStore: Manages Food products.
  • ClothingStore: Manages Clothing products.
  • ElectronicShop: Manages Electronics products.
  • OnlineShop: A flexible inventory that can manage any type of Product.

Each inventory class includes methods to:

  • Add products (restricted to the correct type per store)
  • Remove products by name
  • Update product details such as quantity and price

Exceptions The system includes custom exceptions for better error handling:

  • InvalidQuantityError: Raised when attempting to set a negative quantity or price.
  • ProductNotAvailableError: Raised when trying to access a product that is not available in the inventory.
  • InvalidProductError: Raised when adding an incorrect product type to a specific inventory type.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

my_inventory_management_library-0.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distributions

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

my_inventory_management_library-0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

My_Inventory_Management_Library-0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file my_inventory_management_library-0.1.tar.gz.

File metadata

File hashes

Hashes for my_inventory_management_library-0.1.tar.gz
Algorithm Hash digest
SHA256 fe1ef90e46fca18f88e4340909cf2abf6b61ea4f9a7f393827b2a6971b897c96
MD5 be04b66049728a681e2b674ab5291bfb
BLAKE2b-256 6ada8fdd00329ca17b5026ed66fff8da147f416db8a576cfdb108f3d623882eb

See more details on using hashes here.

File details

Details for the file my_inventory_management_library-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for my_inventory_management_library-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26534a41f6c092f5f0e5e4749a42ae0f7874b8444ea3697b94a9ef449794a9c5
MD5 c7f0b349de6176c9c4986d9f530fb866
BLAKE2b-256 0ab2bbcc53020f2a0687049ee3a03026e1e0214e9bcdd1605f22263e592d6bba

See more details on using hashes here.

File details

Details for the file My_Inventory_Management_Library-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for My_Inventory_Management_Library-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1671b0d400d745ac34d1e92451dbbf3f1b02637249da12d7134db0a94aef2673
MD5 4831cf2c81723724b6226a2bf56a299f
BLAKE2b-256 693e9de918508bf7d91b62c63ce68dc8c60385c86140a65240095d485e6f3df6

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