A simple Python-based application to keep track of lost and found items, supporting classification, searching, and weather integration for found items.
- Add Items: Record any lost or found item with its details: name, description, type, category, location, and contact info.
- Search: Find items by type (lost/found) and location.
- Display: Print all current lost/found items, including status and details.
- Weather Integration: For found items, fetches and stores the current weather at the item's location (via OpenWeatherMap).
- User Roles: Users have unique IDs and can report or search for items.
- Python 3.x
- requests (for weather API)
- Modular, extensible object-oriented design
- Python 3.x
- requests
Install dependencies with:
pip install requestsOr, if you want to make a requirements file, add:
requests
to requirements.txt and run:
pip install -r requirements.txtlost_and_found/
admin.py # Administration utilities (not detailed above)
electronic_item.py # Electronic item specifics
enums.py # Enumerations for categories and statuses
item.py # Core Item class
lost_and_found_system.py # System logic (main interface)
non_electronic_item.py # Non-electronic item specifics
system.py # (Details not shown; possibly system settings/entry point)
tests/ # Unit tests
user.py # User class (report/search items)
weather.py # Weather info integration (uses requests)
from lost_and_found.lost_and_found_system import LostAndFoundSystem
from lost_and_found.item import Item
from lost_and_found.enums import ItemType, Category
system = LostAndFoundSystem()
item = Item(
name="iPhone",
description="Black iPhone 12",
item_type=ItemType.LOST,
category=Category.ELECTRONIC,
location="Library",
contact_info="alice@example.com"
)
system.add_item(item)
# Search for lost phones in Library
results = system.search(ItemType.LOST, "Library")
for it in results:
print(it)- Clone the repo:
git clone https://github.com/IrumShehryar/Lost-and-Found-System.git cd Lost-and-Found-System - (Optional) Create a virtual environment:
python3 -m venv venv source venv/bin/activate - Install dependencies:
pip install requests # or, if you created requirements.txt: pip install -r requirements.txt
- To use weather integration, the file
weather.pyincludes an OpenWeatherMap API key placeholder. - Replace the
API_KEYinweather.pywith your own from OpenWeatherMap for production use.