https://github.com/tweag/FawltyDeps
Python dependency checker
https://github.com/tweag/FawltyDeps
python
Last synced: 25 days ago
JSON representation
Python dependency checker
- Host: GitHub
- URL: https://github.com/tweag/FawltyDeps
- Owner: tweag
- License: other
- Created: 2022-12-06T09:46:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-06T13:13:51.000Z (27 days ago)
- Last Synced: 2025-05-06T14:36:57.342Z (27 days ago)
- Topics: python
- Language: Python
- Homepage:
- Size: 17.9 MB
- Stars: 245
- Watchers: 8
- Forks: 19
- Open Issues: 78
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-pyproject - FawltyDeps - Find undeclared and unused dependencies in your Python project. Verify that your declared dependencies (in `pyproject.toml` or elsewhere) match what you actually `import` in your code. (Packaging & Project Management)
README
[](https://pypi.org/project/fawltydeps/) [](https://pypi.org/project/fawltydeps/)  [](https://pypi.org/project/fawltydeps/) [](code_of_conduct.md) [](https://discord.gg/V2d9xpgD4D)
# FawltyDeps
FawltyDeps is a dependency checker for Python that finds _undeclared_ and/or
_unused_ 3rd-party dependencies in your Python project.
The name is inspired by the Monty Python-adjacent
[Fawlty Towers](https://en.wikipedia.org/wiki/Fawlty_Towers) sitcom.📝 Full documentation available at: [tweag.github.io/FawltyDeps](https://tweag.github.io/FawltyDeps/)

We [invite you](https://discord.gg/V2d9xpgD4D) to join our [Discord channel](https://discord.com/channels/1174731094726295632/1176462512212951090)! It's a great place to ask questions, share your ideas, and collaborate with other contributors.
## Key Concepts
- **_undeclared_ dependency**: a package that's used (in particular, `import`ed) by a project and which lacks a corresponding declaration to ensure that it's available.
For example, you `import numpy`, but you've forgotten to include `numpy` in your `requirements.txt`.
Pragmatically, this means the project is prone to runtime errors.
- **_unused_ dependency**: a package that's declared as necessary for a project but which is never used by project code.
For example, you have `numpy` listed in your `requirements.txt`, but you never actually `import numpy`.
Pragmatically, this means that project installation may consume more space than needed and will be more likely to break with future software releases; in short, these are costs paid for no benefit.Your project dependencies may look like this:
![]()
But FawltyDeps is all about helping you get to this perfect green spot:
![]()
## Installation
The library is distributed with PyPI, so simply:
```sh
pip install fawltydeps
```or any other way to install Python packages from PyPI should be enough to make it available in your environment.
Consider adding `fawltydeps` to your development dependencies, to help you catch undeclared and unused dependencies in your projects.
## Usage
To check the project in the current directory run:
```sh
fawltydeps
```This will find imports in all the Python code under the current directory,
extract dependencies declared by your project, and then report
[_undeclared_ and _unused_ dependencies](#key-concepts).## Development
For details on setting up your development environment, please refer to the
contributing guidelines of how to [set up your development environment](./docs/CONTRIBUTING.md#set-up-your-development-environment)
in our [CONTRIBUTING.md](./docs/CONTRIBUTING.md) file.