Skip to content

Commit

Permalink
feat: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
agusmakmun committed Apr 4, 2024
1 parent c01b4b9 commit 6de9589
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
# scan-unused-requirements
# ScanReq

Python tool to scan all unused packages in requirements.txt file for your project.
**ScanReq** - Python tool to scan all unused packages in requirements.txt file for your project.

## Background

One popular tool for checking requirements in a Python project is `pipdeptree`. However, the problem arises when we don't know which packages listed in the `requirements.txt` file are actually being used in the project or not. It's easy to check if your project is small, but as your project grows larger, it becomes a headache to check one by one.

So, this tool comes in handy for easily identifying which exact packages are actually unused in our project.

### Benefits

> **Note:** Don't forget to double cross-check after finding the unused packages, \
> because sometimes they are used in different cases without being imported in the code. \
> For example: `argon2-cffi` used in `settings.PASSWORD_HASHERS = ["django.contrib.auth.hashers.Argon2PasswordHasher", ...]` for Django.
1. **Save Money**: Remove unused dependencies to lower hosting costs.
2. **Speed Up**: Faster installation and build times mean quicker development.
3. **Use Resources Wisely**: Free up disk and memory space by removing what you don't use.
4. **Easier Maintenance**: Keep your project cleaner and simpler for easier management.
5. **Focus Better**: Work with only what you need, enhancing productivity.
6. **Update Efficiently**: Ensure your dependencies are up-to-date for smoother compatibility.
7. **Stay Safe**: Reduce the chance of security vulnerabilities by trimming unnecessary dependencies.
8. **Stay Legal**: Avoid licensing issues by managing dependencies more effectively.
9. **Work Together**: Simplify collaboration with a consistent set of dependencies.
10. **Code Better**: Keep your documentation and codebase cleaner for improved quality.


## Usage
Expand Down Expand Up @@ -44,15 +52,21 @@ optional arguments:
-p PATH, --path PATH Project path to scan for unused packages (default: current directory).
```

> **Note:** Don't forget to cross-check the unused packages after finding them,
> because sometimes they are used in different cases without being imported in the code.
> For example: `argon2-cffi` used in `settings.PASSWORD_HASHERS = ["django.contrib.auth.hashers.Argon2PasswordHasher", ...]` for Django.

## ToDo List

- [x] Support sys argv (command arguments)
- [x] Support argument parser (command arguments)
- [x] Directory to scan
- [x] Requirement file to scan
- [ ] Option to auto replace the package from requirements.txt file
- [ ] Option to auto replace the package from requirements.txt file
- [ ] Option to exclude or ignore some packages
- [ ] Support multiple python versions
- [ ] Make it as a command by adding file to /bin
- [ ] Support CLI - make it as a command
- [ ] Support multiple devices (Linux, Macbook, and Windows)
- [ ] Write some tests
- [ ] Publish to PyPi
- [ ] Support scan the `pyproject.toml`

0 comments on commit 6de9589

Please sign in to comment.