dynamic-pip-1.1.1
توضیحات
Help users to dynamically manage python package resources
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | dynamic-pip-1.1.1 |
| نام | dynamic-pip |
| نسخه کتابخانه | 1.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | xin.he |
| ایمیل نویسنده | unknow@dynamic-pip.com |
| آدرس صفحه اصلی | https://github.com/uguisu/dynamic-pip |
| آدرس اینترنتی | https://pypi.org/project/dynamic-pip/ |
| مجوز | Apache 2.0 |
# Dynamic Pip

_Photo by David Dibert: https://www.pexels.com/photo/green-and-gray-evergreen-cargo-ship-1117210/_
Help users to dynamically manage python package resources and bid farewell to the constraints of the `requirements.txt` file.
<p align="center">
<img src="https://img.shields.io/badge/Python-3.7%2F3.8%2F3.9-blue" alt="valid for python3.7/3.8/3.9" />
<img src="https://img.shields.io/badge/Apache-2.0-blue" alt="license" />
</p>
## Build-in `pip`
Refer: https://pip.pypa.io/en/stable/cli/pip_install/
## Dynamic-Pip
Through `DynamicPip` class object, dynamically manage (install, delete, etc.) python packages during the execution of the program. In addition, compared to build-in `pip`, `dynamic-pip` also supports some extended functions.
Example: Install the `numpy` package at runtime
```py
from dynamicPip import DynamicPip
dynamic_pip = DynamicPip()
# declare target package
target_package = 'numpy==1.21.6'
# install
print(f'----- install {target_package} test -----')
rtn = dynamic_pip.install_single_package(target_package)
print(f'return result code {rtn}\n')
# check package list
print(f'----- list {target_package} test -----')
rtn = DynamicPip.list_package()
print(f'return result {rtn}\n')
# uninstall single package
print(f'----- uninstall {target_package} test -----')
rtn = DynamicPip.remove_single_package(target_package)
print(f'return result code {rtn}\n')
del dynamic_pip
```
Example: Build a requirement map
```python
from dynamicPip import DynamicPip
dynamic_pip = DynamicPip()
dynamic_pip.generate_requires_map()
```
Example: List all installed packages. (`pip list`)
```python
# check package as dict. (key = package name, value = version )
rtn = dynamic_pip.list_package()
print(f'return result {rtn}\n')
```
Example: Generate a requirement map
```python
dynamic_pip.generate_requires_map(target_output_requirements__map_file_name)
```

## Features
- [x] support install / uninstall specific package(s) at runtime
- [x] install / uninstall from the given requirements file
- [x] support python test unit
- [x] support multiple index-url, auto-detect fastest PyPI mirror
- [x] support extra-index-url
- [x] export requirements file
- [x] build requires map
## Limitations
- [ ] official `inspect` function is still in the experimental stage.
- [ ] official `--dry-run` function is still in the experimental stage.
- [ ] official `--report` function is still in the experimental stage.
## Future version
- [ ] generate a report about all installed packages
- [ ] find package exist
- [ ] auto-detect packages with custom version from github
- [ ] verify hash
- [ ] install from local file
- [ ] install from compressed file
- [ ] install from FTP
- [ ] dynamic `import`
نیازمندی
| مقدار | نام |
|---|---|
| ==3.0.3 | icmplib |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl dynamic-pip-1.1.1:
pip install dynamic-pip-1.1.1.whl
نصب پکیج tar.gz dynamic-pip-1.1.1:
pip install dynamic-pip-1.1.1.tar.gz