Metadata-Version: 2.4
Name: req-scanner
Version: 0.2.0
Summary: A smart tool to analyze, generate, and check Python project requirements.
Author-email: ARsemi4699 <mohali1381@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Arsemi4699 
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/Arsemi4699/req-scanner
Project-URL: Bug Tracker, https://github.com/Arsemi4699/req-scanner/issues
Keywords: requirements,pip,dependencies,scanner,cli
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: packaging>=21.0
Dynamic: license-file

Req-Scanner: The Smart Requirements Tool 🐍Req-Scanner is a powerful command-line tool designed to bring sanity to your Python project's dependencies. It analyzes your project's imports, compares them against your requirements.txt file, and helps you create a clean, minimal, and accurate list of dependencies.Stop guessing which packages are really needed. Let req-scanner do the work for you. Key Features🎯 Accurate Import Detection: Uses Python's ast module to safely and accurately find all imported packages.🔍 Smart Dependency Analysis: Distinguishes between primary packages (directly imported) and their transitive dependencies. ✅ Comprehensive check command: Validates your requirements.txt against 4 crucial rules to ensure consistency. ✨ Clean generate command: Creates a perfect requirements.txt file from your project, optionally including all necessary dependencies. 🤖 CI/CD Friendly: Exits with a non-zero status code on errors, making it perfect for use in automated workflows.InstallationInstall req-scanner directly from PyPI:pip install req-scanner
Usagereq-scanner is simple to use and has two main commands: check and generate.check: Verify Your RequirementsThe check command is your best friend for maintaining a healthy requirements.txt. It verifies your project against 4 strict rules.# Run the check against the default requirements.txt
req-scanner check /path/to/your/project

# Specify a different requirements file
req-scanner check . --file dev-requirements.txt

# Ignore certain directories or files
req-scanner check . --ignore venv build "*.pyc"
The check command will report:❌ Error (Rule 2): Primary packages imported in your code but missing from the file.❌ Error (Rule 3): Primary packages that are missing their own dependencies in the file.❌ Error (Rule 4): Packages listed in the file that aren't installed in your environment.⚠️ Warning (Rule 1): Packages in the file that are never imported and are not dependencies.generate: Create a Perfect Requirements FileUse the generate command to create a clean requirements.txt from scratch based on your project's imports.# Generate a file with only primary (directly imported) packages
req-scanner generate /path/to/your/project -o minimal-reqs.txt

# Generate a complete file with all dependencies included (recommended)
req-scanner generate . --include-deps -o requirements.txt
ContributingContributions are welcome! Please feel free to open an issue or submit a pull request.LicenseThis project is licensed under the MIT License - see the LICENSE file for details.
