deepwiki-export
deepwiki-export 是一个命令行工具,用于从 DeepWiki 或 GitHub URL 下载内容并将其处理为按章节组织的多个 Markdown 文件。GitHub URL 会被自动转换为相应的 DeepWiki URL。
功能
- 从 DeepWiki/GitHub 页面提取主要内容。
- 将提取的每个内容块(章节)保存为单独的 Markdown 文件。
- 输出文件保存在一个根据 URL 自动命名的子目录中,该子目录位于用户指定的基础输出目录下。
- 对于 GitHub URL,子目录结构为
username/reponame/。 - 支持保留原始下载的 HTML 文件(保存在同一子目录中)。
- 可配置请求和文件编码。
安装
通过 pip 从 PyPI 安装 (当发布后):
pip install deepwiki-export
或者从源代码本地安装 (用于开发):
pip install -e .
使用方法
python -m deepwiki_export.cli_tool [OPTIONS] URL
或者,如果通过 pip 安装并已添加到 PATH:
deepwiki-export [OPTIONS] URL
参数
URL: (必需) 要处理的 GitHub 或 DeepWiki URL。
选项
| 选项 | 缩写 | 描述 | 默认值 |
|---|---|---|---|
--output-base-dir DIR |
-o |
基础输出目录。将在此目录下创建一个新的子目录user_name/repo_name来存储输出文件。 |
. (当前目录) |
--keep-html |
保存原始下载的 HTML 文件(将保存在自动生成的输出子目录中)。 | False |
|
--html-encoding ENCODING |
下载的 HTML 内容的编码。 | utf-8 |
|
--md-encoding ENCODING |
输出 Markdown 文件的编码。如果未设置,则默认为 HTML 编码。 | None |
|
--user-agent STRING |
HTTP 请求的自定义 User-Agent 字符串。覆盖默认值。 | None |
|
--timeout SECONDS |
HTTP 请求超时(秒)。 | 30 |
|
--version |
显示应用程序版本并退出。 | ||
--verbose |
-v |
启用详细输出 (DEBUG 级别日志记录)。 | False |
--help |
-h |
显示帮助信息并退出。 |
示例
假设您要从 Roo Code 项目的某个 DeepWiki 页面导出内容,并希望输出到当前目录下的 my_exports 基础目录中:
deepwiki-export --output-base-dir ./my_exports "https://deepwiki.com/RooVetGit/Roo-Code/some-page" --keep-html
这将:
- 从指定的 DeepWiki URL 下载内容。
- 在
./my_exports/目录下创建一个名为RooVetGit_Roo-Code(或类似,取决于derive_dirname_from_url的具体实现) 的子目录。 - 在该子目录 (
./my_exports/RooVetGit_Roo-Code/) 内,将每个提取的章节保存为单独的 Markdown 文件 (例如chapter_1.md,chapter_2.md, ...)。 - 同时,原始 HTML 文件 (例如
_original_page.html) 也会保存在这个子目录中。
贡献
欢迎提出问题、错误报告和功能请求。
许可证
本项目根据 MIT 许可证 授权。
Metadata
Release files for deepwiki-export 0.2.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 |
|---|---|---|---|---|
| deepwiki_export-0.2.1.tar.gz | 14.0 kB | Without provenance | Details for deepwiki_export-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deepwiki_export-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for deepwiki_export-0.2.1-py3-none-any.whl |
Total release size: 29.7 kB
Release files / deepwiki_export-0.2.1.tar.gz
| Download URL | deepwiki_export-0.2.1.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f14a0ba9c1f92b1e9978e8704839b0eb43ee0be4f06fda5e9cd57b669eecd5cb
|
|
BLAKE2b-256 checksum How to use checksums |
9745db0107101dfabef59328182cb0b1aa74074f90ba8287ce8428416516141e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.2 Windows/11
|
Release files / deepwiki_export-0.2.1-py3-none-any.whl
| Download URL | deepwiki_export-0.2.1-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff4b466d6f5521c52090d1b547819005d77a1fa77878b543729a03e75a2b9b46
|
|
BLAKE2b-256 checksum How to use checksums |
50942d4cedf660f42080f49e77ac0d1a56a3c27f5e0f279cd762df6787e8fe9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.2 Windows/11
|
Security for deepwiki-export 0.2.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.