Listreqs
Listreqs is a simple requirements.txt generator. It's an alternative to pipreqs. --> pip install Listreqs
Install / Use
/learn @soumya997/ListreqsREADME
<h1 align="center">⚡Listreqs</h1>
<p align="center">
<a href=""><img alt="Contributions Welcome" src="https://img.shields.io/badge/contributions-welcome-brightgreen?style=for-the-badge&labelColor=black&logo=github"></a>
<br/>
<img alt="GitHub" src="https://img.shields.io/github/license/soumya997/Listreqs?style=for-the-badge">
</p>
<p align="center">
<img src="https://forthebadge.com/images/badges/built-with-love.svg"> <img src="https://forthebadge.com/images/badges/made-with-python.svg"> <img src="https://forthebadge.com/images/badges/open-source.svg"> <img src="https://forthebadge.com/images/badges/made-with-reason.svg">
</p> <i> <strong><code>Listreqs</code></strong> is a simple <strong><code>requirements.txt</code></strong> generator. <strong><code>It's an alternative to pipreqs</code></strong>. Where in Pipreqs, it helps you to Generate requirements.txt file for any project based on imports, but in Listreqs you need to create a <strong>virtual environment first</strong>, and do your required installations there. And when you need to create your <strong><code>requirements.txt</code></strong> use Listreqs. </i> </p> <br> <!--   -->| Using shell script | Using python script |
:-------------------------:|:-------------------------:
| 
How to use:
Use the only python script:
- Create your virtual env,
- pip install virtualenv - mkdir TextGenEnv - virtualenv TextGenEnv - activate the env: + for cmd -> TextGenEnv\Scripts\activate + (for git bash, source ./Scripts/activate) + (for linux terminal, source TextGenEnv/bin/activate) - do your required installations there
- And when you need to create your requirements.txt do these steps,
- activate the environment using above command
pip list > requirements.txt-> it will put the output of thepip listcommand inside therequirements.txtpython listreqs.pyand give the path of the previously createdrequirements.txt
- Boom!!!
Use only shell script:
- Create your virtual env,
- pip install virtualenv - mkdir TextGenEnv - virtualenv TextGenEnv - activate the env: + TextGenEnv\Scripts\activate + (for bash source ./Scripts/activate) - do your required installations there
- And when you need to create your requirements.txt do these steps,
sh listreqs.shand pass the file namerequirements.txt.- Boom!!!
- heads up while using the shell script,
-
Usage:
- Can pass in as a positional(command line) argument:
bash listreqs.sh reqs.txt- Can input the file name from the prompt after running the shell script
bash listreqs.sh Enter the requirements file name : reqs.txt- Not passing any input will lead to the creation of a default file called
requirements.txt.
bash listreqs.sh Enter the requirements file name :
-
Know more about How to create virtual environment:
<a target="_blank" href="https://github-readme-medium-recent-article.vercel.app/medium/@khanfarhan10/3"><img src="https://github-readme-medium-recent-article.vercel.app/medium/@khanfarhan10/3" alt="Recent Article 3">
todos:
- [x] Create a single shell script to get the job done.
- [x] Use the python script to create a python library:
It should be like a shell command,like doing
Listreqs requirements.txtafter activating the virtual environment should create arequirements.txtwith all the installed package name and verison inside the current directory. - [ ] Create
requirements.txtfrom a public repo whererequirements.txtis not given. Usepython poetryfor this. - [ ] Create
requirements.txtfrom base environment, using basic regex
