Skip to main content

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
  • Finds unused methods (coming soon)
  • Detects duplicate method implementations (coming soon)
  • Identifies unused templates

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
==============================

Potentially Unused URLs:
- /api/v1/old-endpoint/ (name: api:old_endpoint)
- /legacy/dashboard/ (name: legacy:dashboard)
- /unused-feature/ (name: unused_feature)

Unused Templates:
- templates/old_feature.html
- templates/legacy/header.html

Note: This is a static analysis and may have false positives.
Please verify these results before making any changes.

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
  3. Analyzing template usage (includes, extends, and view rendering)
  4. Filtering out common false positives (admin, auth, etc.)
  5. 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.1 with URL and template analysis functionality. More features are planned for future releases.

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.1.tar.gz (5.1 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.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_project_scrubber-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 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.1.tar.gz
Algorithm Hash digest
SHA256 60573960da9332dddb3b8f83e2f66f672c8c0bcc69702f05d0d8f03137259ee1
MD5 aac9420149b9a21218af75ea83755680
BLAKE2b-256 3b41cdaa3d5641759dff312e2a7661620cc83589e1bc0911abd2d66b84afe090

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_project_scrubber-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 37d49187a01724fb60791d640cc774b316e07ffe5ebac9111c5ec0be499f874c
MD5 925f3308ce76a7ad4776eca0a45a3fd7
BLAKE2b-256 eaf5f3191ea16b6fe5a84beb3ed7a757450e0dac36cf7560bd9d3b16c2f9ce9a

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