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
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file my_inventory_management_library-0.1.tar.gz.
File metadata
- Download URL: my_inventory_management_library-0.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe1ef90e46fca18f88e4340909cf2abf6b61ea4f9a7f393827b2a6971b897c96
|
|
| MD5 |
be04b66049728a681e2b674ab5291bfb
|
|
| BLAKE2b-256 |
6ada8fdd00329ca17b5026ed66fff8da147f416db8a576cfdb108f3d623882eb
|
File details
Details for the file my_inventory_management_library-0.1-py3-none-any.whl.
File metadata
- Download URL: my_inventory_management_library-0.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26534a41f6c092f5f0e5e4749a42ae0f7874b8444ea3697b94a9ef449794a9c5
|
|
| MD5 |
c7f0b349de6176c9c4986d9f530fb866
|
|
| BLAKE2b-256 |
0ab2bbcc53020f2a0687049ee3a03026e1e0214e9bcdd1605f22263e592d6bba
|
File details
Details for the file My_Inventory_Management_Library-0.1-py3-none-any.whl.
File metadata
- Download URL: My_Inventory_Management_Library-0.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1671b0d400d745ac34d1e92451dbbf3f1b02637249da12d7134db0a94aef2673
|
|
| MD5 |
4831cf2c81723724b6226a2bf56a299f
|
|
| BLAKE2b-256 |
693e9de918508bf7d91b62c63ce68dc8c60385c86140a65240095d485e6f3df6
|