An Object-Oriented Python dashboard for tracking and managing urban natural resources
🏙️ Smart City · ♻️ Sustainability · 📊 Real-Time Analytics
Demo • Features • Installation • Usage • Documentation
- Overview
- Problem Statement
- Features
- OOP Principles
- Installation
- Usage
- Project Structure
- Architecture
- Technologies Used
- Screenshots
- Future Enhancements
- Contributing
- License
- Contact
The Sustainable Resource Management System is a comprehensive solution designed to help urban areas efficiently track and manage critical natural resources including water, electricity, and waste. Built with Python's Object-Oriented Programming principles, this system provides a clean, scalable architecture suitable for real-world deployment.
Urban areas face increasing challenges in resource management:
- 🌊 Water scarcity affecting millions globally
- ⚡ Energy demand growing exponentially
- ♻️ Waste management becoming critical for sustainability
This system provides:
- Real-time resource monitoring
- Consumer-wise consumption tracking
- Data-driven insights for better decision-making
- Scalable architecture for enterprise deployment
Urban areas require efficient tracking and management of natural resources such as water, energy, and waste to promote sustainability and reduce environmental impact.
- Model a realistic resource management system using OOP
- Track resource consumption across multiple consumers
- Provide real-time analytics and reporting
- Ensure data integrity and safe resource allocation
- Create a production-ready, deployable solution
-
✅ Resource Management
- Water (source tracking)
- Energy (type classification: Solar/Wind/Thermal)
- Waste (category management: Organic/Recyclable/Hazardous)
-
✅ Consumer Operations
- Multiple consumer support (Residential/Commercial/Industrial)
- Real-time consumption tracking
- Historical consumption logs
- Resource allocation management
-
✅ Safety & Validation
- Prevents over-consumption (insufficient resource handling)
- Validates positive values
- Enforces resource assignment checks
- Maintains audit trail
-
🎨 Modern Dashboard
- White/light theme with nature-inspired colors
- Smooth animations and transitions
- Responsive design (desktop/tablet/mobile)
- Interactive Lottie animations
-
📊 Analytics & Reporting
- Resource utilization percentages
- Consumption breakdowns
- Event tracking
- Exportable reports (tables)
-
🌐 Streamlit Web App
- Clean, intuitive interface
- Real-time updates
- No-code deployment ready
- Session state management
This project strictly follows Object-Oriented Programming best practices:
# Private attributes with property accessors
class Resource:
def __init__(self, name: str, total_available: float):
self._name = name # Private attribute
self._total_available = total_available
@property
def name(self) -> str:
return self._name # Controlled access# Base class
class Resource:
# Common functionality
# Derived classes
class WaterResource(Resource):
# Water-specific attributes (source)
class EnergyResource(Resource):
# Energy-specific attributes (energy_type)
class WasteResource(Resource):
# Waste-specific attributes (waste_category)# Each subclass overrides report_usage() to add specific metadata
water.report_usage() # Returns water-specific report (litres, source)
energy.report_usage() # Returns energy-specific report (kWh, type)
waste.report_usage() # Returns waste-specific report (kg, category)# Consumer class delegates to Resource class
consumer.use_resource(water, 100) # Abstract interface
# Internally calls: water.update_availability(100)- Business Logic:
models/directory (framework-independent) - Presentation:
app.py(UI layer, uses Streamlit) - Testing:
main.py(console-based validation)
- Python 3.9 or higher
- pip (Python package manager)
git clone https://github.com/yourusername/sustainable-resource-management.git
cd sustainable-resource-management# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtrequirements.txt:
streamlit>=1.30.0
streamlit-lottie>=0.0.5
requests>=2.31.0If requirements.txt doesn't exist, install manually:
pip install streamlit streamlit-lottie requestsstreamlit run app.py- Opens automatically in your browser at
http://localhost:8501 - Interactive UI with real-time updates
- Production-ready interface
python main.py- Demonstrates all features in terminal
- Shows edge cases (validation, error handling)
- Useful for testing and understanding core logic
- View Resources: Check available Water, Energy, Waste
- Select Consumer: Choose a consumer (Residential/Factory)
- Consume Resource: Enter amount and submit
- View Reports: Expand consumer reports to see detailed analytics
OOP in Python/
│
├── models/ # Business logic (framework-independent)
│ ├── __init__.py # Package exports
│ ├── resource.py # Resource base class + subclasses
│ └── consumer.py # Consumer class
│
├── app.py # Streamlit web app (UI layer)
├── main.py # Console-based demo
├── README.md # Project documentation
├── requirements.txt # Python dependencies
│
└── .gitignore # Git ignore rules
| File | Purpose | Lines | Key Classes |
|---|---|---|---|
models/resource.py |
Resource hierarchy | ~250 | Resource, WaterResource, EnergyResource, WasteResource |
models/consumer.py |
Consumer management | ~120 | Consumer |
app.py |
Streamlit dashboard | ~850 | N/A (UI only) |
main.py |
Console demo | ~135 | N/A (testing) |
┌─────────────────────────────┐
│ Resource │ ◄─── Base Class
│─────────────────────────────│
│ - _name: str │
│ - _total_available: float │
│ - _renewable: bool │
│ - _usage_log: list │
│─────────────────────────────│
│ + report_usage() → dict │
│ + update_availability() │
└─────────────────────────────┘
▲
│ (inherits)
┌──────┴──────┬──────────┬──────────┐
│ │ │ │
┌───▼──────┐ ┌───▼──────┐ ┌─▼─────────┐
│ Water │ │ Energy │ │ Waste │
│ Resource │ │ Resource │ │ Resource │
├──────────┤ ├──────────┤ ├───────────┤
│ -source │ │-energy │ │-waste │
│ │ │ _type │ │ _category │
└──────────┘ └──────────┘ └───────────┘
┌─────────────────────────────┐
│ Consumer │
│─────────────────────────────│
│ - _consumer_id │
│ - _name: str │
│ - _assigned_resources: list │
│─────────────────────────────│
│ + use_resource() │
│ + assign_resource() │
│ + generate_usage_report() │
└─────────────────────────────┘
User Input (UI)
↓
Consumer.use_resource(resource, amount)
↓
Resource.update_availability(amount)
↓
Validation (amount > 0, sufficient availability)
↓
Update internal state + log transaction
↓
Return result to UI (success/error message)
| Technology | Purpose | Version |
|---|---|---|
| Python | Core programming language | 3.9+ |
| Streamlit | Web dashboard framework | 1.30+ |
| streamlit-lottie | Animated icons/illustrations | 0.0.5+ |
| Type Hints | Static type checking | Built-in |
| Docstrings | Code documentation | NumPy style |
- Python: Industry-standard for data/backend, excellent OOP support
- Streamlit: Rapid prototyping, zero-config deployment, Python-native
- Lottie: Professional animations without performance overhead
- Type Hints: Self-documenting code, catches bugs early
Resource cards with real-time metrics, utilization bars, and animations
Interactive form for consuming resources with validation
Detailed breakdown per consumer with consumption history
Smooth, professional Lottie animations throughout the interface
Note: Screenshots are illustrative. Actual UI may vary.
🔗 [Coming Soon - Streamlit Cloud Deployment]
📹 [Coming Soon - YouTube Demo]
- Add user authentication (login/logout)
- Export reports to PDF/Excel
- Add more resource types (Gas, Telecom)
- Email/SMS alerts for low resources
- Dark mode toggle
- Database integration (PostgreSQL/MongoDB)
- RESTful API layer
- Mobile app (Flutter/React Native)
- Predictive analytics (ML models)
- Multi-language support
- IoT sensor integration
- Real-time streaming data (Kafka)
- Microservices architecture
- Blockchain for audit trails
- AI-powered optimization recommendations
Contributions are welcome! Here's how you can help:
- Bug Reports: Found a bug? Open an issue!
- Feature Requests: Have an idea? Share it!
- Code Contributions: Submit a pull request
- Documentation: Improve README, add comments
- Testing: Write unit tests, integration tests
# 1. Fork the repository
# 2. Create a feature branch
git checkout -b feature/amazing-feature
# 3. Make your changes
# 4. Commit with clear messages
git commit -m "Add amazing feature"
# 5. Push to your fork
git push origin feature/amazing-feature
# 6. Open a Pull Request- Follow PEP 8 style guide
- Add type hints for all functions
- Write docstrings (NumPy style)
- Include unit tests for new features
- Update README if needed
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2026 Pranav Kadam
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
Pranav Kadam
📧 Email: your.email@example.com
🔗 LinkedIn: linkedin.com/in/yourprofile
🐙 GitHub: @yourusername
- Streamlit team for the amazing framework
- LottieFiles for beautiful animations
- Python Software Foundation for Python
- Open Source Community for inspiration