NAME
dist-info - получить информацию об установленном дистрибутиве
VERSION
0.1.1
SYNOPSIS
# Устанавливаваем некий модуль:
$ pip3 install pytest
# И затем в питоне:
# @@ examples.py
from dist_info import dists, \
src, src_path, dist_info_paths, egg, dist_path, \
metadata, files, modules, \
modules_in_dir, modules_from, \
imports, imports_from
# Список всех установленных пакетов:
packages = dists()
# -> ['Brlapi', 'Dumper', ...]
DIST_NAME = 'pytest'
# Получаем пути к каталогам с файлами пакета:
src_dirs = src(DIST_NAME)
# -> ['/home/dart/.local/lib/python3.6/site-packages/pytest']
# Получаем путь к последнему каталогу с файлами пакета:
src_dir = src_path(DIST_NAME)
# -> '/home/dart/.local/lib/python3.6/site-packages/pytest'
# Обычно у пакета только один такой каталог, но у пакетов cryptography или bcrypt, например, по несколько.
# Получаем каталоги с подкаталогами пакета и путь к метаинформации
# (может быть как файлом, так и каталогом):
dist_dir, egg_dir = dist_info_paths(DIST_NAME)
# -> '/home/dart/.local/lib/python3.6/site-packages',
# '/home/dart/.local/lib/python3.6/site-packages/pytest-5.4.1.dist-info'
# Для краткости были сделаны функции dist_path и egg, возвращающие dist_dir и egg_dir соответственно:
dist_dir = dist_path(DIST_NAME)
# -> '/home/dart/.local/lib/python3.6/site-packages'
egg_dir = egg(DIST_NAME)
# -> '/home/dart/.local/lib/python3.6/site-packages/pytest-5.4.1.dist-info'
# Получаем файлы
package_files = files(DIST_NAME)
# [ '/home/dart/.local/lib/python3.6/site-packages/../../../bin/py.test',
# '/home/dart/.local/lib/python3.6/site-packages/../../../bin/pytest', ... ]
# Получаем модули пакета:
package_modules = modules(DIST_NAME)
# -> ['_pytest', '_pytest._argcomplete', ...]
# Получаем словарь с краткой информацией о пакете:
meta_dict = metadata(DIST_NAME)
# -> {'Name': 'pytest', ...}
# Получаем модули в указанном каталоге:
the_modules = modules_in_dir(".")
# -> ['x', 'x.y', 'x.y.z', ...]
# Получаем подмодули модуля (например, io.six - ищется в sys.path):
the_modules = modules_from("io.six")
# -> ['io.six.bar', 'io.six.bar.baz', ...]
# импортирует все указанные модули в текущий модуль (тут в examples.py)
# остальные параметры принимает те же, что и __import__
# imports(modules, globals=None, locals=None, fromlist=(), level=0)
# возвращает список результатов __import__
import_returns = imports(the_modules)
# Есть сокращение для imports( modules_from(module), *av, **kw ):
the_modules, import_returns = imports_from("io.six")
DESCRIPTION
Позволяет получить модули установленного пакета, файлы и пути к каталогу с метаинформацией пакета, так и каталогу в котром стоит пакет.
Распознаются dist-info, egg-info и egg-link.
В дистрибутив входит одноимённая утилита:
Вывести список каталогов с модулями (sys.path):
$ dist -s
$ dist --syspath
Вывести все установленные дистрибутивы:
$ dist-info
Вывести сводную информацию о дистрибутиве:
$ dist-info <дистрибутив>
Вывести каталог в котором находятся модули пакета:
$ dist-info <дистрибутив> dist
Вывести путь к файлу или каталогу с метаинформацией:
$ dist-info <дистрибутив> egg
Вывести сокращённую метаинформацию:
$ dist-info <дистрибутив> meta
Вывести файлы:
$ dist-info <дистрибутив> files
Вывести модули:
$ dist-info [-c|--check] <дистрибутив> modules
Вывести модули по указанному пути:
$ dist-info [-c|--check] <каталог> mod
Вывести подмодули модуля (например, io.six - ищется в sys.path):
$ dist-info [-c|--check] <модуль> mods
INSTALL
$ pip3 install dist-info
REQUIREMENTS
- data-printer
AUTHOR
Kosmina O. Yaroslav darviarush@mail.ru
LICENSE
MIT License
Copyright (c) 2020 Kosmina O. Yaroslav
Metadata
Release files for dist-info 0.1.1
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 |
|---|---|---|---|---|
| dist-info-0.1.1.tar.gz | 6.6 kB | Without provenance | Details for dist-info-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dist_info-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for dist_info-0.1.1-py3-none-any.whl |
Total release size: 13.9 kB
Release files / dist-info-0.1.1.tar.gz
| Download URL | dist-info-0.1.1.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3bb04c8a7983b5efd582cd72c7ee6f5b3286020372d5acd2bfbc71738251df5
|
|
BLAKE2b-256 checksum How to use checksums |
028a56603d04a60aab552b605d06302a517c6c7e86d078c0ffd71c6a475428c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
|
Release files / dist_info-0.1.1-py3-none-any.whl
| Download URL | dist_info-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e38ecce6bcea2470f1896b9faf341cc78711f172eb0ccc995ff40adfa17a6654
|
|
BLAKE2b-256 checksum How to use checksums |
33f557fae73ee622ce328b836850110fb4bcbc81f8d6e3f28fbf5059148ec50f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
|
Security for dist-info 0.1.1
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.