A fantastic tool to generate requirements for your Python project, and more than that.
# Generate requirements.txt for current directory. $ pigar # Generate requirements for given directory in given file. $ pigar -p ../dev-requirements.txt -P ../
pigar will list all files which referenced the package, for example:
# project/foo.py: 2,3 # project/bar/baz.py: 2,7,8,9 foobar == 3.3.3
If requirements file is overwritten over, pigar will show difference between old and new.
If you do not know the import name that belongs to a specific package (more generally, does Import Error: xxx drive you crazy?), such as bs4 which may come from beautifulsoup4 or MySQLdb which could come from MySQL_Python, try searching for it:
$ pigar -s bs4 MySQLdb
To check requirements for the latest version, just do:
# Specific a requirements file. $ pigar -c ./requirements.txt # Or, you can leave pigar search *requirements.txt in current directory # level by itself, if not found, pigar will generate requirements.txt # for current project then check latest version. $ pigar -c
You can find more information on GitHub .
Thank @spacewander for the following contributions:
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|pigar-0.7.0-py2.py3-none-any.whl (3.4 MB) Copy SHA256 Checksum SHA256||py2.py3||Wheel||Jun 3, 2017|
|pigar-0.7.0.tar.gz (3.4 MB) Copy SHA256 Checksum SHA256||–||Source||Jun 3, 2017|