https://github.com/zeke/summarize-python-requirements
Annotate your Python requirements.txt file with summaries of each package.
https://github.com/zeke/summarize-python-requirements
cli dependencies python
Last synced: about 1 year ago
JSON representation
Annotate your Python requirements.txt file with summaries of each package.
- Host: GitHub
- URL: https://github.com/zeke/summarize-python-requirements
- Owner: zeke
- License: mit
- Created: 2021-10-09T04:43:52.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-15T17:30:25.000Z (over 4 years ago)
- Last Synced: 2025-04-20T10:56:54.027Z (about 1 year ago)
- Topics: cli, dependencies, python
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Summarize Requirements 🐍 📜
Annotate your Python `requirements.txt` file with a short summary of each package.
This tool:
- takes a Python `requirements.txt` file as input
- fetches the summary of each package from the PyPi registry
- outputs an equivalent requirements list with added comments summarizing each package
It can be used as a Python module or a command line script.
## Example
Before:
```
black==21.9b0
gunicorn==20.1.0
pytz==2021.3
requests==2.26.0
rope==0.20.1
whitenoise==5.3.0
```
After:
```
black==21.9b0 # The uncompromising code formatter.
gunicorn==20.1.0 # WSGI HTTP Server for UNIX
pytz==2021.3 # World timezone definitions, modern and historical
requests==2.26.0 # Python HTTP for Humans.
rope==0.20.1 # a python refactoring library...
whitenoise==5.3.0 # Radically simplified static file serving for WSGI applications
```
## Installation
Note: This is not a published package yet. For now:
```sh
git clone https://github.com/zeke/summarize-requirements
cd summarize-requirements
```
## Command Line Usage
The CLI reads a requirements file as input and prints summarized results as output. It does not overwrite the existing file.
If you run the command with no arguments, it'll look for `requirements.txt` in the current directory:
```sh
python index.py
```
Or you can specify a different file:
```sh
python index.py ~/path/to/your/requirements.txt > new-requirements.txt
```
## Programmatic Usage
```py
from summarize import summarize
for line in summarize('requirements.txt'):
print(line)
```