A fantastic tool to generate requirements for your Python project, and more than that.
Project description
Features
Generate requirements for project, pigar can consider all kinds of complicated situations. In this project, py2_requirements.txt and py3_requirements.txt for different python versions
# 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
More
You can find more information on GitHub .
Change Logs
Version 0.9.0 (2018.08.12)
Reuse connections.
Update database.
Fixed #44
Version 0.7.2 (2018.04.24)
Fixed #41
Version 0.7.1 (2017.11.07)
Fixed #34
Version 0.7.0 (2017.07.03)
Fixed the .egg suffix which caused by sudo pip install … on Ubuntu.
Workaround for special packages, such as #29
Version 0.6.10 (2016.06.17)
Fixed #26
Fixed relative import issue.
Version 0.6.9 (2016.05.08)
Fixed ImportError.
Version 0.6.8 (2016.05.08)
Supported flask extension.
Sorted requirements.
Use gevent if possible.
Version 0.6.7 (2015.12.13)
If modules in the try...except... block, assume they are optional.
Version 0.6.6 (2015.11.22)
Fixed IndexError.
Version 0.6.5 (2015.11.22)
Fixed AttributeError.
Fixed PEP8 warning.
Version 0.6.4 (2015.11.22)
Removed useless code.
Cache modules, to avoid duplication of inspection.
Thank @spacewander for the following contributions:
Fixed error for Python 2.7.6.
Fixed error when using ‘./xxx’ as relative path.
Support importlib.import_module and __import__.
Version 0.6.3 (2015.11.09)
Sort files, make comments more clearer.
Fixed grammar, to make the README clearer. Thank @roryokane and @flyingfisch.
Make it work with python -m pigar. Thank @lilydjwg.
Fixed the pep8 warnings: #15.
Make output more clearer: #12.
Fixed UnicodeDecodeError for Python 3.
Version 0.6.2 (2015.11.05)
If requirements file is overwritten over, show difference between old and new.
Adjust the structure of the code.
Version 0.6.1 (2015.11.03)
Fixed typo.
Follow symlinks.
Version 0.6.0 (2015.10.30)
Enhancement: issue #7, show imported module come from which files.
Consider package installed via Git.
Add command “-i”, used to ignore a list of directory.
Version 0.5.5 (2015.10.21)
Version 0.5.2-0.5.4 (2015.10.6)
Fixed issue #1.
Make version compare more effective.
Removed useless code.
Version 0.5.1 (2015.10.01)
Available in PyPI(https://pypi-hypernode.com/pypi/pigar).
Generate requirements for Python project.
Can consider different for different Python versions.
Search package names by imported names.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pigar-0.9.0.tar.gz
.
File metadata
- Download URL: pigar-0.9.0.tar.gz
- Upload date:
- Size: 4.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/36.6.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4329b0963b673a01e6354658ba148b3853361b4ae28ed18a4fe4c43414c5be4 |
|
MD5 | 31e63ecc1ecb1352f14975350123c763 |
|
BLAKE2b-256 | 1fccacba6c9ce8f26a929db51168023be47718bcc77091910e5ed89710c11ae5 |
File details
Details for the file pigar-0.9.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pigar-0.9.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.6 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/36.6.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a0627e597448e91807cde4377d3024f112191cb31e90dd229ccd42938f62170 |
|
MD5 | 8351cf13b31689f9088d8a0b3ea83e41 |
|
BLAKE2b-256 | aae6e86b51e8916b399d11633e341e8713849f5d382ea28c7a81da3e195ca358 |