How mrugakshi77/depradar works
DepRadar scans Python dependencies submitted as package lists, requirements content, or GitHub repositories, then returns per-package risk findings and an overall score. The main flow enters through the API, parses or fetches dependency input where needed, runs bounded package lookups with PyPI and OSV, applies risk classification, and persists scan and cache records for reports. The README also documents a CLI, single-package lookup, health checks, and a browser frontend. Relationships reflect the shown route and service calls plus documented capabilities; the frontend and CLI implementation paths were not sampled.
Main entry points: scan.py Scan endpoints · main.py FastAPI app · scan_service.py Scan orchestration · database.py Database sessions
Components 21
API entrypoints
- FastAPI app
app/main.py - Scan endpoints
app/routes/scan.py - Package lookup
app/routes/package.py - Health checks
app/routes/health.py - API schemas
app/schemas/package.py
Scan and risk analysis
- Requirements parser
app/services/parser.py - GitHub file fetch
app/services/github.py - Scan orchestration
app/services/scan_service.py - Risk assessment
app/services/scan_service.py
Cache and persistence
- Database sessions
app/db/database.py - Scan and cache records
app/models/package.py - Relational database
External sources
- PyPI and OSV lookup
app/services/pypi.py - Runtime settings
app/core/config.py
Other components
- User or CI
- CLI commands
cli/depradar.py - Browser SPA
frontend/index.html - PyPI
- OSV.dev
- GitHub
- Risk report
Connections 31
- User or CI → FastAPI app: uses
README.md - CLI commands → FastAPI app: calls API
README.md - Browser SPA → FastAPI app: uses API
- FastAPI app → Scan endpoints: registers
app/main.py - FastAPI app → Package lookup: registers
app/main.py - FastAPI app → Health checks: registers
app/main.py - FastAPI app → Database sessions: initializes
app/main.py - Scan endpoints → API schemas: validates and returns
app/routes/scan.py - Scan endpoints → Requirements parser: parses content
app/routes/scan.py - Scan endpoints → GitHub file fetch: fetches requirements
app/routes/scan.py - Scan endpoints → Scan orchestration: runs and retrieves
app/routes/scan.py - Scan endpoints → Scan and cache records: reads cache records
app/routes/scan.py - Scan endpoints → Risk report: builds report
app/routes/scan.py - Package lookup → Scan orchestration: refreshes package cache
app/routes/package.py - Package lookup → API schemas: returns lookup schema
app/routes/package.py - Health checks → Database sessions: checks database
app/routes/health.py - Health checks → GitHub file fetch: checks reachability
app/routes/health.py - Scan orchestration → Risk assessment: classifies and scores
app/services/scan_service.py - Scan orchestration → PyPI and OSV lookup: fetches package data
app/services/scan_service.py - Scan orchestration → Database sessions: reads and writes
app/services/scan_service.py - Scan orchestration → Scan and cache records: creates scan records
app/services/scan_service.py - PyPI and OSV lookup → Runtime settings: uses API settings
app/services/pypi.py - GitHub file fetch → Runtime settings: uses API settings
app/services/github.py - Database sessions → Runtime settings: uses database URL
app/db/database.py - Database sessions → Relational database: connects
- Scan and cache records → Database sessions: uses ORM base
app/models/package.py - PyPI and OSV lookup → PyPI: queries metadata
- PyPI and OSV lookup → OSV.dev: queries vulnerabilities
- GitHub file fetch → GitHub: resolves and fetches
- Health checks → PyPI: checks reachability
- Health checks → OSV.dev: checks reachability