A tool to analyze Django projects for unused components
Project description
Django Project Scrubber
A powerful tool to analyze Django projects for unused components, helping you keep your codebase clean and maintainable.
Features
- Identifies potentially unused URLs (including namespaced URLs and Django built-in URLs)
- Finds unused methods (coming soon)
- Detects duplicate method implementations (coming soon)
- Identifies unused templates (with improved include/extends detection and Django template analysis)
Installation
pip install django-project-scrubber
Usage
To analyze a Django project, run:
django_scrubber /path/to/your/django/project
The tool will analyze your project and display a summary of findings, including:
- Potentially unused URLs (excluding admin and auth URLs)
- Unused methods (coming in future versions)
- Duplicate method implementations (coming in future versions)
- Unused templates (including analysis of includes, extends, and view usage)
Example Output
Django Project Analysis Summary
==============================
✅ No unused URLs found! All URLs are being used.
✅ No unused methods found! All methods are being used.
✅ No duplicate methods found! All methods are unique.
✅ No unused templates found! All templates are being used.
🎉 Great news! Your Django project is clean and well-maintained.
No unused components were found in your codebase.
How It Works
The Django Project Scrubber analyzes your Django project by:
- Scanning all URL patterns in your project
- Checking URL usage in templates and code (including namespaced URLs)
- Analyzing Django source code for built-in URL and template usage
- Analyzing template usage (includes, extends, and view rendering)
- Filtering out common false positives (admin, auth, etc.)
- Providing a clear summary of potentially unused components
Requirements
- Python 3.8 or higher
- Django 3.0 or higher
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License
Author
HappyMinsker - GitHub
Project Status
This is version 0.1.3 with improved URL and template analysis functionality. More features are planned for future releases.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_project_scrubber-0.1.3.tar.gz.
File metadata
- Download URL: django_project_scrubber-0.1.3.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00166649254b20b3a48d0f22741ead9beabab754c1712563e8ee11cfaa5ae5db
|
|
| MD5 |
c28eaa09fdaa08cfa647918ca85af867
|
|
| BLAKE2b-256 |
56b6bd12880f4015ade2f5e15fed2d25b22c7caacc780b798e6adaf8e2249bff
|
File details
Details for the file django_project_scrubber-0.1.3-py3-none-any.whl.
File metadata
- Download URL: django_project_scrubber-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0adb2ade20ac7ee76439b88e6a09aec24f7f86011c6006611e3885a0ad0a2c4
|
|
| MD5 |
12f4f00685634d40cfc05f90fa4f7934
|
|
| BLAKE2b-256 |
ffe482c1d3c01b779661b793bc0547d34f1a666722afe1595440248e10e48115
|