Name | depscan JSON |
Version |
0.1.5
JSON |
| download |
home_page | None |
Summary | A fast Python dependency analyzer that automatically discovers and extracts third-party imports |
upload_time | 2025-01-08 07:04:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | MIT |
keywords |
analyzer
dependency
imports
requirements
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# depscan 🔍
A Python dependency analyzer inspired by Black's implementation that automatically discovers and extracts third-party imports from your Python projects. It scans your codebase to identify external dependencies while filtering out project-internal imports.
## Features ✨
- Follows Black's approach to traverse Python files
- Smart package name resolution (e.g., `PIL` → `pillow`, `cv2` → `opencv-python`)
- Filters out both standard library and project-internal imports
- Handles common import name mismatches
- Generates `requirements.txt` file
- Parallel processing for faster scanning
⚠️ Note: The tool may occasionally fail to identify some dependencies due to complex import patterns or dynamic imports.
## Installation 📦
```bash
pip install depscan
```
## Usage 🚀
You can use depscan either as a module or directly as a command (like Black):
```bash
# As a command (recommended)
depscan src/
depscan . # Current directory
depscan src/ tests/ # Multiple paths
# As a module
python -m depscan src/
python -m depscan .
```
Options:
```bash
depscan src/ --no-save # Don't generate requirements file
depscan src/ --workers 4 # Specify number of parallel workers
```
## How it Works 🛠️
1. Traverses Python files using Black's file discovery approach
2. Uses AST parsing to safely extract imports
3. Filters out standard library and project-internal imports
4. Maps common import aliases to their correct PyPI package names
5. Generates a clean requirements file
## Output 📝
The tool will:
1. Show all scanned files
2. List discovered third-party dependencies
3. Generate a `requirements.txt` file (or `requirements-depscan.txt` if the former exists)
## Known Limitations 🚧
- May not detect dependencies from dynamic imports
- Some complex import patterns might be missed
- Package name mapping might not cover all cases
## Contributing 🤝
Found a bug or want to improve the package name mapping? Contributions are welcome! Please feel free to submit a Pull Request.
## License 📄
[MIT](LICENSE)
Raw data
{
"_id": null,
"home_page": null,
"name": "depscan",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "analyzer, dependency, imports, requirements",
"author": null,
"author_email": "linkedlist771 <213193509seu@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/62/f9/e76e74a12249c2d4e2977658de6021b79a56ec9f357566ecec3cddd37c31/depscan-0.1.5.tar.gz",
"platform": null,
"description": "# depscan \ud83d\udd0d\n\nA Python dependency analyzer inspired by Black's implementation that automatically discovers and extracts third-party imports from your Python projects. It scans your codebase to identify external dependencies while filtering out project-internal imports.\n\n## Features \u2728\n\n- Follows Black's approach to traverse Python files\n- Smart package name resolution (e.g., `PIL` \u2192 `pillow`, `cv2` \u2192 `opencv-python`)\n- Filters out both standard library and project-internal imports\n- Handles common import name mismatches\n- Generates `requirements.txt` file\n- Parallel processing for faster scanning\n\n\u26a0\ufe0f Note: The tool may occasionally fail to identify some dependencies due to complex import patterns or dynamic imports.\n\n## Installation \ud83d\udce6\n\n```bash\npip install depscan\n```\n\n## Usage \ud83d\ude80\n\nYou can use depscan either as a module or directly as a command (like Black):\n\n```bash\n# As a command (recommended)\ndepscan src/\ndepscan . # Current directory\ndepscan src/ tests/ # Multiple paths\n\n# As a module\npython -m depscan src/\npython -m depscan .\n```\n\nOptions:\n\n```bash\ndepscan src/ --no-save # Don't generate requirements file\ndepscan src/ --workers 4 # Specify number of parallel workers\n```\n\n## How it Works \ud83d\udee0\ufe0f\n\n1. Traverses Python files using Black's file discovery approach\n2. Uses AST parsing to safely extract imports\n3. Filters out standard library and project-internal imports\n4. Maps common import aliases to their correct PyPI package names\n5. Generates a clean requirements file\n\n## Output \ud83d\udcdd\n\nThe tool will:\n\n1. Show all scanned files\n2. List discovered third-party dependencies\n3. Generate a `requirements.txt` file (or `requirements-depscan.txt` if the former exists)\n\n## Known Limitations \ud83d\udea7\n\n- May not detect dependencies from dynamic imports\n- Some complex import patterns might be missed\n- Package name mapping might not cover all cases\n\n## Contributing \ud83e\udd1d\n\nFound a bug or want to improve the package name mapping? Contributions are welcome! Please feel free to submit a Pull Request.\n\n## License \ud83d\udcc4\n\n[MIT](LICENSE)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A fast Python dependency analyzer that automatically discovers and extracts third-party imports",
"version": "0.1.5",
"project_urls": {
"Homepage": "https://github.com/linkedlist771/depscan",
"Repository": "https://github.com/linkedlist771/depscan.git"
},
"split_keywords": [
"analyzer",
" dependency",
" imports",
" requirements"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e2f227ee71beb283551a1a6e86bc9bcc2fdc8cf1ae4d736ee5dbbd47fc4a9220",
"md5": "0b85387df8f79b7a285d26942cfc20d3",
"sha256": "6b229d100c6c2d5893918627a4180beb3be785837b2b04b8729f24f63bc1ebc6"
},
"downloads": -1,
"filename": "depscan-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0b85387df8f79b7a285d26942cfc20d3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 10278,
"upload_time": "2025-01-08T07:04:03",
"upload_time_iso_8601": "2025-01-08T07:04:03.585699Z",
"url": "https://files.pythonhosted.org/packages/e2/f2/27ee71beb283551a1a6e86bc9bcc2fdc8cf1ae4d736ee5dbbd47fc4a9220/depscan-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "62f9e76e74a12249c2d4e2977658de6021b79a56ec9f357566ecec3cddd37c31",
"md5": "46d0dc890a9d26add076dc47dc5e6895",
"sha256": "0f6aa66cbc72b2a7dd821b7dca4de2cec1147939f9a735a874c2c9bf52df76bf"
},
"downloads": -1,
"filename": "depscan-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "46d0dc890a9d26add076dc47dc5e6895",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10669,
"upload_time": "2025-01-08T07:04:06",
"upload_time_iso_8601": "2025-01-08T07:04:06.136886Z",
"url": "https://files.pythonhosted.org/packages/62/f9/e76e74a12249c2d4e2977658de6021b79a56ec9f357566ecec3cddd37c31/depscan-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-08 07:04:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "linkedlist771",
"github_project": "depscan",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "depscan"
}