Find project modules and data files (packages and package_data for setup.py).
Project description
Find project modules and data files (packages and package_data for setup.py).
Installation
install from PyPI:
python3 -m pip install --user dephell_discover
Usage
from pathlib import Path
from dephell_discover import Root
root = Root(path=Path('../dephell'))
# get packages:
root.packages
# [Package(path=Path('../dephell/dephell'), root=Path('../dephell')), ...]
# get package data:
root.data
# {Data(path=Path('../dephell/dephell/templates'), ext='.j2', package=Package(...)), ...}
# package properies:
p = root.packages[-1]
p.path # Path('../dephell/dephell/commands')
p.root # Path('../dephell')
p.module # 'dephell.commands'
str(p) # 'dephell.commands'
list(p) # [Path('../dephell/dephell/commands/base.py'), ...]
# data properties:
d = next(iter(root.data))
d.path # Path('../dephell/dephell/templates')
d.ext # .j2
d.package # Package(path=Path('../dephell/dephell'), root=...)
d.module # 'dephell'
# relative path from package root:
d.relative # 'templates/*.j2'
str(d) # 'templates/*.j2'
list(d) # [Path('../dephell/dephell/templates/python.html.j2'), ...]
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
dephell_discover-0.1.1.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for dephell_discover-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 654a73ad5df6f193468c87021f1883fe231e297ec7f97b634abf5b068d963d1c |
|
MD5 | fb1a7dc147c3d3e6f07e1af55f26339c |
|
BLAKE2b-256 | 0df0f9e1d0ddc3d48edc807567f84edbed3a4a267c8dfae7b5c7e271a97ca413 |