pymin_reqs
This module attempt to make a minimal requirements.txt file based on the imports are used inside of the code of your project, .py files. These requirements are a subset of what would be given using pip freeze or conda list --export as these commands give everything that is used inside of the Python environment. This is useful if a project is used inside of a shared environment or if you want a cleaner requirements.txt that only has your imported modules but not the dependencies, and sub-dependencies, of those modules.
Install With Pip
python3 -m pip install pymin-reqs
Usage
usage: pymin_reqs [-h] [-d DIRECTORY] [--conda] [--pip] [-f] [-s] [-v] [-e] [-o OUTFILE]
optional arguments:
-h, --help show this help message and exit
-d DIRECTORY, --directory DIRECTORY
Specify the input directory. Default: '.'
--conda Output conda requirements instead of pip. Use --pip --conda to show both
--pip Show pip requirements. not required by default unless --conda is also specified
-f, --force Force overwrite of the given file in --outfile
-s, --stats Show import locations and count of imported modules.
-v, --verbose Verbose mode
-e, --ignore-errors Ignore errors when possible
-o OUTFILE, --outfile OUTFILE
Specify the output file. Default 'requirements.txt'
Examples
Show requirements on command line
pymin_reqs
Output requirements to a file "requirements.txt"
pymin_reqs -o requirements.txt
Output requirements to a file "requirements.txt" and force overwrite
pymin_reqs -f -o requirements.txt
This module uses the abstract syntax tree(ast module) to find imports. If there are invalid python file this might cause errors in parsing. To get around this you can specify --ignore-errors
pymin_reqs --ignore-errors
Example output from commands
pip==20.2.4
setuptools==50.3.1
Metadata
Release files for pymin-reqs 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pymin-reqs-1.0.2.tar.gz | 4.8 kB | Without provenance | Details for pymin-reqs-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymin_reqs-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for pymin_reqs-1.0.2-py3-none-any.whl |
Total release size: 10.7 kB
Release files / pymin-reqs-1.0.2.tar.gz
| Download URL | pymin-reqs-1.0.2.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c13e193cc94d1d618bdd0025a5ac49d90ad1da42c487c6c222d5dd664c64741a
|
|
BLAKE2b-256 checksum How to use checksums |
e6a50b3865a236818c1ef7376a5fd43328aabf3752611f042bbb1d8294b09051
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.6.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|
Release files / pymin_reqs-1.0.2-py3-none-any.whl
| Download URL | pymin_reqs-1.0.2-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b4684c6f407be94f0ac00da76b7e60b87c0b3372bcbed4149efd6b15ced09f2
|
|
BLAKE2b-256 checksum How to use checksums |
ca3abd430a4910269f043b8fea0410d17755097f53e84694a0fd54633a62d8c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.6.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|
Security for pymin-reqs 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.