将ChatGPT导出的对话转换为Markdown文件
Project description
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生态系统标准
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
chatgpt_to_md-0.1.0.tar.gz
(4.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chatgpt_to_md-0.1.0.tar.gz.
File metadata
- Download URL: chatgpt_to_md-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82983768861ea95c56250718e88cf4acdf414755f3a2dcf560558b75065b9341
|
|
| MD5 |
e4e89488514114a600e10b5be8c12f13
|
|
| BLAKE2b-256 |
9e456cc3f5db45e4814233d6ce548a975cc24480eac1b20c51c66223b0eaf539
|
File details
Details for the file chatgpt_to_md-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chatgpt_to_md-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
badf7f47c676fb56042359d89234bbfb3933e7a3293eb75d2b10c575259ebd4d
|
|
| MD5 |
2b0e9c063c90647b520aebc35c719511
|
|
| BLAKE2b-256 |
f80a67afefddc9c722847d9de0b81538acdf566dda171981088fb9da37094715
|