ChatGPT to Markdown
一个简单的工具,将ChatGPT导出的zip文件转换为漂亮的Markdown文件。
安装
pip install chatgpt-to-md
使用方法
命令行使用
# 基本用法
chatgpt-to-md conversation.zip
# 指定输出目录
chatgpt-to-md conversation.zip -o ./my_chats
Python中使用
from chatgpt_to_md import convert
convert("conversation.zip", "./output")
功能特点
- ✅ 自动解压zip文件
- ✅ 转换所有对话为独立的Markdown文件
- ✅ 包含YAML front matter元数据
- ✅ 按时间排序对话消息
- ✅ 自动处理文件名中的非法字符
许可证
MIT
## 5. 许可证文件 (`LICENSE`)
```text
MIT License
Copyright (c) 2024 Your Name
Permission is hereby granted...
发布流程
1. 本地开发和测试
# 进入项目目录
cd chatgpt-to-md
# 安装为开发模式
pip install -e .
# 测试功能
chatgpt-to-md test_conversation.zip -o ./test_output
2. 构建包
# 安装构建工具
pip install build
# 构建包
python -m build
这会生成 dist/ 目录,包含 .whl 和 .tar.gz 文件。
3. 发布到 PyPI
# 安装上传工具
pip install twine
# 上传到 PyPI
twine upload dist/*
使用方式
作为用户安装使用
# 从PyPI安装
pip install chatgpt-to-md
# 使用
chatgpt-to-md my_chatgpt_data.zip -o ./conversations
作为开发者使用
from chatgpt_to_md import convert
# 在代码中使用
convert("path/to/chatgpt.zip", "./output_directory")
项目特点
- 最简依赖: 只使用Python标准库,无外部依赖
- 单一功能: 专注完成一个核心任务
- 易于理解: 代码结构清晰,便于学习和修改
- 即装即用: 安装后直接通过命令行使用
- 标准化: 符合Python包发布标准
这个架构让你能够:
- ✅ 快速理解整个发布流程
- ✅ 轻松维护和扩展
- ✅ 让其他用户方便安装使用
- ✅ 符合Python生态系统标准
Metadata
Release files for chatgpt-to-md 0.1.0
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 |
|---|---|---|---|---|
| chatgpt_to_md-0.1.0.tar.gz | 4.4 kB | Without provenance | Details for chatgpt_to_md-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chatgpt_to_md-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for chatgpt_to_md-0.1.0-py3-none-any.whl |
Total release size: 9.3 kB
Release files / chatgpt_to_md-0.1.0.tar.gz
| Download URL | chatgpt_to_md-0.1.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82983768861ea95c56250718e88cf4acdf414755f3a2dcf560558b75065b9341
|
|
BLAKE2b-256 checksum How to use checksums |
9e456cc3f5db45e4814233d6ce548a975cc24480eac1b20c51c66223b0eaf539
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / chatgpt_to_md-0.1.0-py3-none-any.whl
| Download URL | chatgpt_to_md-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
badf7f47c676fb56042359d89234bbfb3933e7a3293eb75d2b10c575259ebd4d
|
|
BLAKE2b-256 checksum How to use checksums |
f80a67afefddc9c722847d9de0b81538acdf566dda171981088fb9da37094715
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for chatgpt-to-md 0.1.0
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.