Skip to main content

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:

  1. Scanning all URL patterns in your project
  2. Checking URL usage in templates and code (including namespaced URLs)
  3. Analyzing Django source code for built-in URL and template usage
  4. Analyzing template usage (includes, extends, and view rendering)
  5. Supporting partial templates (files starting with underscore)
  6. Detecting URLs in template attributes (href, form actions)
  7. Identifying templates used in class-based views and error handlers
  8. Marking templates that use URLs as used
  9. Filtering out common false positives (admin, auth, etc.)
  10. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_project_scrubber-0.1.8.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_project_scrubber-0.1.8-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file django_project_scrubber-0.1.8.tar.gz.

File metadata

  • Download URL: django_project_scrubber-0.1.8.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

Hashes for django_project_scrubber-0.1.8.tar.gz
Algorithm Hash digest
SHA256 6bc9012f3d0b7a18f9ff7693f974858057455abc9132c5219b07a67502aad5bf
MD5 9ca36823d412e453d86ae3d4f0f3cfc6
BLAKE2b-256 a9e6709910b14625d04304452f75b2a2d2fb1d10431495df9657429fd32aab32

See more details on using hashes here.

File details

Details for the file django_project_scrubber-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for django_project_scrubber-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ea83d7c67781f043ce00504614d65a0958ece75f1c491c3f8df05966c2a74c74
MD5 7f326f01b248b5eb57219c586813e138
BLAKE2b-256 9fbdddac7048029951e5a80b2fe24e1e5ec01249c6d31443df80a589feeff283

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page