A tool to analyze Django projects for unused components
Project description
Django Project Scrubber
A tool to analyze Django projects for unused components, helping you keep your codebase clean and maintainable.
Features
- 🔍 Find unused URLs in your Django project
- 📄 Identify unused templates
- 🔄 Detect duplicate method names
- 🧹 Clean up unused code
- 🚀 Improved URL detection with support for namespaced URLs
- 📝 Enhanced template analysis with dynamic scanning
- 🎯 Better console output with positive messages
- 🔧 Support for Python 3.8 through 3.11
Installation
pip install django-project-scrubber
Usage
django_scrubber /path/to/your/django/project
Project Status
Version 0.1.7 - Enhanced URL and template analysis with improved detection patterns and better console output.
License
MIT License
Author
HappyMinsker - GitHub
How It Works
The Django Project Scrubber analyzes your Django project by:
- Scanning URL patterns in urls.py files
- Checking URL usage in templates by looking for URL names in template tags
- Analyzing template usage by searching for template names in Python files and other templates
- Supporting partial templates (files starting with underscore)
- Providing a summary of potentially unused URLs and templates
Note: This is a static analysis tool and may have false positives. It's recommended to:
- Review the results carefully before making any changes
- Consider that some URLs might be used dynamically or through JavaScript
- Some templates might be used in ways not detected by the tool
- Check for any custom URL resolution or template loading mechanisms in your project
Requirements
- Python 3.8 or higher
- Django 3.0 or higher
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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.9.tar.gz.
File metadata
- Download URL: django_project_scrubber-0.1.9.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11cee5a7925998738538d5a5a9db418a210717532359d996c6bd46963e7c34c9
|
|
| MD5 |
dab348ffeacfb9a029efe26fe83eb181
|
|
| BLAKE2b-256 |
709144210a5298724afdf9fd90b9d97b893cfa1e389e686b56d87dc216797e10
|
File details
Details for the file django_project_scrubber-0.1.9-py3-none-any.whl.
File metadata
- Download URL: django_project_scrubber-0.1.9-py3-none-any.whl
- Upload date:
- Size: 5.6 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 |
0988c03fbd1758a1cfd2c3298c0c4f47226bd0d818f63013dbbe8f94eacc44ab
|
|
| MD5 |
c8ce8c2916d38d144bd319470b8d5bbc
|
|
| BLAKE2b-256 |
cd7df857f211fbef641e463890d7169ef261eae57cd908db0cfb0c642608974a
|