TransparAI is an open-source AI-powered dashboard that analyzes public procurement data to expose bias, inefficiency, and anomalies. Built for the SFLC.in Hackathon under the theme "Defending Digital Rights through Open Source Innovation."
The dashboard provides real-time transparency into government contracting processes using machine learning to detect suspicious patterns and promote accountability.
-
π At-a-Glance Summary
- Total contracts, value, and vendor metrics
- Real-time procurement overview
- Key performance indicators
-
π¨ AI Anomaly Detection
- Isolation Forest machine learning algorithm
- Detection of suspicious contract values
- Interactive scatter plots for visualization
-
π’ Vendor Concentration Analysis
- Market distribution analysis
- Top vendor share percentages
- Contract value distribution charts
-
β±οΈ Procurement Efficiency Tracking
- Time-to-award analysis
- Processing delay identification
- Monthly trend analysis
- SFLC.in Brand Compliance: Official colors (#1486c9) and Noto Sans typography
- Responsive Design: Works on desktop and mobile devices
- Accessibility: WCAG AA compliant with proper contrast ratios
- Real-time Data: Integration with Government e-Marketplace (GeM) APIs
- Python 3.8 or higher
- pip (Python package manager)
- Clone or download the project
# If using git
git clone <repository-url>
cd TransparAI-Dashboard
# Or simply extract the project folder- Install dependencies
pip install -r requirements.txt- Run the application
streamlit run app.pyOpen your browser and navigate to http://localhost:8501
Run the setup script
.\run_dashboard.ps1Or use the batch file
.\run_dashboard.batThese scripts will automatically:
- Check for Python installation
- Create a virtual environment
- Install all dependencies
- Launch the dashboard
- Government e-Marketplace (GeM) API - Real-time contract data
- Open Government Data Platform India - Supplementary datasets
- Generated realistic Indian procurement data for demonstration
- Includes contracts from major vendors and ministries
- Anomalies artificially introduced for testing detection algorithms
TransparAI-Dashboard/
βββ app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ run_dashboard.ps1 # PowerShell launch script
βββ run_dashboard.bat # Windows batch launch script
βββ .gitignore # Git ignore rules
βββ config/
β βββ settings.json # Application configuration
βββ data/
β βββ sample_procurement_data.csv # Generated sample data
β βββ sample_procurement_data.json # JSON format sample data
βββ src/
β βββ data_generator.py # Sample data generation utility
βββ utils/
β βββ helpers.py # Data processing and API utilities
βββ tests/
β βββ test_dashboard.py # Test cases
βββ models/ # Machine learning models
βββ assets/ # Static assets (images, etc.)
The dashboard supports multiple data sources accessible via the sidebar:
- Real-time API: Fetches live data from government portals
- Sample Data: Uses generated dataset for demonstration
Edit config/settings.json to modify:
- API endpoints
- Anomaly detection parameters
- Styling and colors
- Analysis thresholds
{
"api_endpoints": {
"gem": "https://api.gem.gov.in/public/api/v1/contracts",
"ogd": "https://api.data.gov.in/resource/"
},
"anomaly_detection": {
"contamination": 0.1,
"random_state": 42
},
"styling": {
"primary_color": "#1486c9",
"font_family": "Noto Sans"
}
}- Algorithm: Isolation Forest from scikit-learn
- Features: Contract value and processing time
- Output: Binary classification of anomalous contracts
- Visualization: Interactive scatter plots with hover details
- Vendor concentration metrics
- Processing time distributions
- Temporal trend analysis
- Category-wise breakdowns
- Primary Font: Noto Sans (Google Fonts)
- Headings: 700 weight
- Subheadings: 500 weight
- Body Text: 400 weight
- Primary: #1486c9 (SFLC.in Blue)
- Secondary: #ff6b6b (Anomaly highlights)
- Background: #f8f9fa (Light gray)
- Text: #333333 (Dark gray)
- Clean, minimal design
- Ample white space
- Consistent spacing
- Mobile-responsive grid
Run the test suite to verify functionality:
python -m pytest tests/test_dashboard.py -vTests include:
- Data processing validation
- Anomaly detection accuracy
- Metric calculation correctness
Generate new sample data:
python src/data_generator.pyThis creates:
data/sample_procurement_data.csvdata/sample_procurement_data.json
streamlit run app.pyThe application can be deployed on:
- Streamlit Cloud
- Heroku
- AWS/Azure/GCP
- Any Python-compatible hosting service
This project is built for the SFLC.in Hackathon. We welcome contributions under the open-source initiative.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
Open Source - SFLC.in Hackathon Project
- SFLC.in for the hackathon platform and guidance
- Government of India for open data initiatives
- Open source community for tools and libraries
- Contributors who help improve transparency in public procurement
For technical issues or questions:
- Check the troubleshooting tips in the application
- Verify your Python environment meets requirements
- Ensure internet connectivity for real-time data features
Built with β€οΈ for Digital Rights Transparency
TransparAI - Defending Digital Rights through Open Source Innovation