A Python-based system for managing and tracking tools in an organization. This application allows users to maintain an inventory of tools, track their usage, schedule maintenance, and monitor tool conditions.
- Add and remove tools from the inventory
- Track tool usage with checkout/return functionality
- Schedule and monitor tool maintenance
- List all tools in the system
- Automatic initialization with default tools
- Predictive maintenance scoring system
- Clone this repository
- Ensure you have Python 3.x installed
- Install required dependencies:
pip install pytestmain.py- Core implementation with tool management functionalitytest_tools.py- Test suite for verifying system functionality
Run the application using:
python main.pyThe system presents a menu-driven interface with the following options:
- Add Tool
- Remove Tool
- Track Tool Usage
- Schedule Maintenance
- List Tools
- Exit
Enter the following information when prompted:
- Tool name
- Category
- Serial number (must be unique)
- Purchase date (YYYY-MM-DD format)
- Current condition
Requires:
- Tool ID
- User name
- Checkout time (YYYY-MM-DD HH:MM format)
- Expected return time (YYYY-MM-DD HH:MM format)
Input needed:
- Tool ID
- Maintenance type
- Scheduled date (YYYY-MM-DD format)
Run the test suite using:
pytest test_tools.pyThe test suite covers:
- Tool addition and validation
- Usage tracking functionality
- Maintenance scheduling
- Predictive maintenance calculations
- Error handling for invalid operations
class Tool:
- tool_id: Unique identifier
- name: Tool name
- category: Tool category
- serial_number: Unique serial number
- purchase_date: Date of purchase
- current_condition: Current tool condition
- current_location: Location tracking
- maintenance_history: List of maintenance records
- total_usage_hours: Cumulative usage timeThe system includes robust error handling for:
- Duplicate serial numbers
- Invalid tool IDs
- Missing tools
- Invalid date formats
Potential improvements could include:
- Database persistence
- User authentication
- Advanced reporting features
- API integration
- Real-time location tracking
- Enhanced predictive maintenance algorithms
MIT