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.4
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.4.tar.gz | 3.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xnjk-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / xnjk-0.0.4.tar.gz
| Download URL | xnjk-0.0.4.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
281f0c79b2ce8ca3e4df24b7338dc884cc2b397a24eb44eaab6f73c12b742eba
|
|
BLAKE2b-256 checksum How to use checksums |
9f81ee3154e3343796caa1573142f94bdc338ea0e3f2bab46637d056b0d42fbe
|
| 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.4-py3-none-any.whl
| Download URL | xnjk-0.0.4-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02000ea7bd09b73386416d5a7b0dc174424ae1064a65e2b788cee78bc1b061a4
|
|
BLAKE2b-256 checksum How to use checksums |
f054bc0da741f1626946633e2881c10f7a920ec24578bc8ef96f5918c4d45296
|
| 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.4
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.