# ShowMeReqs
A lightweight command-line tool that generates requirements.txt by analyzing import statements in your Python projects.
## Features
- Intelligent third-party import detection
- Automatic requirements.txt generation with versions in current env
- Display missing packages in current environment
- Display import names that differ from PyPI package names for manual review
- Generate a clean requirements.txt file or a detail one
## Installation
Install via pip:
```bash
pip install showmereqs
```
## Usage
Generate requirements.txt for current directory:
```bash
showmereqs .
```
Or specify a project path:
```bash
showmereqs path/to/your/project
```
## Examples
- #### Detail Output
```
# generated by showmereqs
# python version: 3.11.7
# package with version in environment
# [package] [import name]
Requests==2.32.3 # requests
click==8.1.7
pytest==8.3.4
# package without version
# [package] [import name]
Pillow # PIL
Theano # theano
aiohttp
numpy
pandas
scipy
tensorflow
torch
typing-extensions # typing_extensions
# can not get package name and version
# [package] [import name]
# None # guidoooo
```
- #### Normal Output
```
# generated by showmereqs
# python version: 3.11.7
Requests==2.32.3
click==8.1.7
pytest==8.3.4
Pillow
Theano
aiohttp
numpy
pandas
scipy
tensorflow
torch
typing-extensions
# can not get package name and version
# [package] [import name]
# None # guidoooo
```
## Command Line Options
```bash
$ showmereqs --help
Usage: showmereqs [OPTIONS] [PATH]
Analyze Python project dependencies and generate requirements.txt
Options:
-f, --force Force overwrite output file if it exists
-nd, --no-detail Generate cleaner requirements.txt with less comments
-o, --outdir TEXT Path to output directory, default is the path you give
-h, --help Show this message and exit
```
### Examples:
```bash
# Generate requirements.txt in current directory
showmereqs .
# Generate in specific output directory
showmereqs . -o /path/to/output
# Force overwrite existing requirements.txt
showmereqs . -f
# Generate clean requirements.txt without comments
showmereqs . --nd
```
## Why ShowMeReqs?
Traditional approaches like `pip freeze` capture all environment dependencies, while modern tools like Poetry can be overly complex for simple needs. ShowMeReqs bridges this gap by offering a streamlined solution that identifies only the dependencies your project actually uses.
Additionally, once ShowMeReqs generates the initial requirements.txt, you can easily migrate to modern package management tools for more comprehensive dependency management.
## Acknowledgments & License
This project is licensed under the Apache License, Version 2.0 - see the [LICENSE](LICENSE) file for details.
ShowMeReqs uses package mapping and stdlib data from [pipreqs](https://github.com/bndr/pipreqs/) under the Apache 2.0 license. As pipreqs development has slowed, ShowMeReqs aims to provide an actively maintained alternative for the Python community.
## Roadmap
Future releases will include:
- Additional CLI options for customization
- Support for excluding specific packages or directories
- Analyze dependencies between missing packages to determine their versions
- Version range specifications
- Integration with other package management tools
Feel free to open issues for feature requests or bug reports.
Raw data
{
"_id": null,
"home_page": null,
"name": "showmereqs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "requirements, dependencies, package-management",
"author": "sunandriver",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/db/18/61293d89854fb3fdaad1296f238944531cb7878b289de5f8dd53a85adab4/showmereqs-0.1.5.tar.gz",
"platform": null,
"description": "# ShowMeReqs\n\nA lightweight command-line tool that generates requirements.txt by analyzing import statements in your Python projects.\n\n## Features\n\n- Intelligent third-party import detection\n- Automatic requirements.txt generation with versions in current env\n- Display missing packages in current environment\n- Display import names that differ from PyPI package names for manual review\n- Generate a clean requirements.txt file or a detail one\n\n## Installation\n\nInstall via pip:\n\n```bash\npip install showmereqs\n```\n\n## Usage\n\nGenerate requirements.txt for current directory:\n\n```bash\nshowmereqs .\n```\n\nOr specify a project path:\n\n```bash\nshowmereqs path/to/your/project\n```\n\n## Examples\n\n- #### Detail Output\n\n```\n# generated by showmereqs\n# python version: 3.11.7\n\n# package with version in environment\n# [package] [import name]\nRequests==2.32.3 # requests\nclick==8.1.7\npytest==8.3.4\n\n# package without version\n# [package] [import name]\nPillow # PIL\nTheano # theano\naiohttp\nnumpy\npandas\nscipy\ntensorflow\ntorch\ntyping-extensions # typing_extensions\n\n# can not get package name and version\n# [package] [import name]\n# None # guidoooo\n```\n\n- #### Normal Output\n\n```\n# generated by showmereqs\n# python version: 3.11.7\n\nRequests==2.32.3\nclick==8.1.7\npytest==8.3.4\n\nPillow\nTheano\naiohttp\nnumpy\npandas\nscipy\ntensorflow\ntorch\ntyping-extensions\n\n# can not get package name and version\n# [package] [import name]\n# None # guidoooo\n\n```\n\n## Command Line Options\n\n```bash\n$ showmereqs --help\nUsage: showmereqs [OPTIONS] [PATH]\n\nAnalyze Python project dependencies and generate requirements.txt\n\nOptions:\n -f, --force Force overwrite output file if it exists\n -nd, --no-detail Generate cleaner requirements.txt with less comments\n -o, --outdir TEXT Path to output directory, default is the path you give\n\n -h, --help Show this message and exit\n```\n\n### Examples:\n\n```bash\n# Generate requirements.txt in current directory\nshowmereqs .\n# Generate in specific output directory\nshowmereqs . -o /path/to/output\n# Force overwrite existing requirements.txt\nshowmereqs . -f\n# Generate clean requirements.txt without comments\nshowmereqs . --nd\n```\n\n## Why ShowMeReqs?\n\nTraditional approaches like `pip freeze` capture all environment dependencies, while modern tools like Poetry can be overly complex for simple needs. ShowMeReqs bridges this gap by offering a streamlined solution that identifies only the dependencies your project actually uses.\n\nAdditionally, once ShowMeReqs generates the initial requirements.txt, you can easily migrate to modern package management tools for more comprehensive dependency management.\n\n## Acknowledgments & License\n\nThis project is licensed under the Apache License, Version 2.0 - see the [LICENSE](LICENSE) file for details.\n\nShowMeReqs uses package mapping and stdlib data from [pipreqs](https://github.com/bndr/pipreqs/) under the Apache 2.0 license. As pipreqs development has slowed, ShowMeReqs aims to provide an actively maintained alternative for the Python community.\n\n## Roadmap\n\nFuture releases will include:\n\n- Additional CLI options for customization\n- Support for excluding specific packages or directories\n- Analyze dependencies between missing packages to determine their versions\n- Version range specifications\n- Integration with other package management tools\n\nFeel free to open issues for feature requests or bug reports.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A lightweight tool to generate requirements.txt by analyzing import statements",
"version": "0.1.5",
"project_urls": {
"Bug Tracker": "https://github.com/sunandriver/showmereqs/issues",
"Homepage": "https://github.com/sunandriver/showmereqs"
},
"split_keywords": [
"requirements",
" dependencies",
" package-management"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6c00393fdd72ec3886ad6591d8ea49442534f564bf60192913da56f4c8adb5d9",
"md5": "f429fb5567342bc793753e11d0c56733",
"sha256": "2adff068765c2d30a0d9c60b552c8571ced294fac62350ff1b666d4c09ba67cb"
},
"downloads": -1,
"filename": "showmereqs-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f429fb5567342bc793753e11d0c56733",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8708,
"upload_time": "2025-01-15T00:17:56",
"upload_time_iso_8601": "2025-01-15T00:17:56.914399Z",
"url": "https://files.pythonhosted.org/packages/6c/00/393fdd72ec3886ad6591d8ea49442534f564bf60192913da56f4c8adb5d9/showmereqs-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "db1861293d89854fb3fdaad1296f238944531cb7878b289de5f8dd53a85adab4",
"md5": "333ace5c34ff004e436beae20aa6fc1f",
"sha256": "4f4027d90d7782e2433f5d6ad8391d67199106f92c4b6822934dd60a2a0581a2"
},
"downloads": -1,
"filename": "showmereqs-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "333ace5c34ff004e436beae20aa6fc1f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 9399,
"upload_time": "2025-01-15T00:17:58",
"upload_time_iso_8601": "2025-01-15T00:17:58.362221Z",
"url": "https://files.pythonhosted.org/packages/db/18/61293d89854fb3fdaad1296f238944531cb7878b289de5f8dd53a85adab4/showmereqs-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-15 00:17:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sunandriver",
"github_project": "showmereqs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "showmereqs"
}