xnjk
English | 中文
把目录渲染成缩进树,可直接贴进 README 或缺陷单。
安装
pip install xnjk
用法
from xnjk import render_tree
print(render_tree("src", n_max_depth=2))
# src/
# ├── pkg/
# │ └── core.py
# └── main.py
render_tree(".", n_show_files=False, n_max_entries=100)
说明
目录排在文件前,两者都按大小写不敏感排序,跨平台输出稳定。不可读目录记 warning 后跳过,不抛错;符号链接不跟随,循环目录不会把程序挂死;超过 n_max_entries 行数停下并标注截断。
许可证
MIT
English
Render a directory as an indented text tree.
Install
pip install xnjk
Usage
from xnjk import render_tree
print(render_tree("src", n_max_depth=2))
# src/
# ├── pkg/
# │ └── core.py
# └── main.py
render_tree(".", n_show_files=False, n_max_entries=100)
Notes
Directories sort before files, both case-insensitively, so output is stable across platforms. Unreadable directories are logged and skipped; symlinks are not followed, so a loop cannot hang the walk. Output stops at n_max_entries with a truncation marker.
License
MIT
Metadata
Release files for xnjk 0.0.3
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 | |
|---|---|---|---|---|
| xnjk-0.0.3.tar.gz | 3.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xnjk-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / xnjk-0.0.3.tar.gz
| Download URL | xnjk-0.0.3.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f51cf545b944deac258e56edff77c2095635216ab27183758c8ebfb5daf948e
|
|
BLAKE2b-256 checksum How to use checksums |
5fe07c4f934e578877fc1b48d1844ce2a1f5f6b59fceb455b538d2292f97063e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / xnjk-0.0.3-py3-none-any.whl
| Download URL | xnjk-0.0.3-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
435b2ef9273e1b0e8a54a9de6af33e379e896ede3cc92941f0490a37838656bf
|
|
BLAKE2b-256 checksum How to use checksums |
dd3361d9aa0582c7ed968c37361130f75054a7049f982e8f18e5038825963df4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for xnjk 0.0.3
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.