Convert DeepSeek conversations.json exports to markdown files
Project description
DeepSeek JSON to Markdown Converter
Tool for converting DeepSeek chat export JSON files (conversations.json) into high-fidelity Markdown files suitable for archival or Obsidian knowledge bases.
Features
- Thinking Process Preservation: Extracts and formats the Model's "Chain of Thought" as blockquoted text (
> [!Thinking] ...). - Template Standardization: Outputs consistent Markdown with Frontmatter, standardized headers (
User/Deepseek), and document structure (背景 / 动机,对话正文,关键结论 / 摘要). - Branch Handling: Automatically detects and exports the final regenerated response in a branching conversation trace.
- Metadata: Includes
createdandmodifiedtimestamps in the Frontmatter using the original conversation data.
Getting Started
Prerequisites
- Python 3.9+
Setup
Prepare three required files/paths:
- DeepSeek export file:
conversations.json - Output directory for markdown files
- Markdown template file with placeholders
Template placeholders supported:
{title}{conversion_created_time}{conversion_export_time}{content}
Run Conversion
Execute the main script from the repository root with required arguments:
python3 src/main.py \
--input ./data/conversations.json \
--output-dir ./deepseek_exported_md \
--template ./output_template.md
You can also run the installed CLI command after package installation:
deepseek-md-export \
--input ./data/conversations.json \
--output-dir ./deepseek_exported_md \
--template ./output_template.md
Optional flag:
-f,--force: overwrite existing markdown files and continue export.- Without
--force, when exporter detects an existing target file, it will stop the whole remaining export immediately.
Output
Converted files will be generated in the directory specified by --output-dir.
Filenames follow the pattern: YYYYMMDD-Title.md.
Packaging & Publish (Poetry)
Build wheel and source distribution:
poetry build
Publish to PyPI (token should be configured first):
poetry config pypi-token.pypi <your-pypi-token>
poetry publish --build
Optional test publish to TestPyPI:
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi <your-testpypi-token>
poetry publish --build -r testpypi
Install from local dist for quick verification:
pip install dist/*.whl
deepseek-md-export --help
Contributing
Any contributions made are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat(module):add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Top contributors:
License
All code is licensed under the AGPL-3.0 license. See LICENSE for more information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 deepseek_json_to_markdown_converter-0.1.2.tar.gz.
File metadata
- Download URL: deepseek_json_to_markdown_converter-0.1.2.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.0 CPython/3.13.1 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c8131be3b74d4e05ddcc9f4dc2103296b9caabb659ee736a6a26f79241caf68
|
|
| MD5 |
1ba937f63a36c50cce496935ce972406
|
|
| BLAKE2b-256 |
9411974b341ff83d33cf551742c1c9eca8038704c6e13cec13d25172d9fbf9fc
|
File details
Details for the file deepseek_json_to_markdown_converter-0.1.2-py3-none-any.whl.
File metadata
- Download URL: deepseek_json_to_markdown_converter-0.1.2-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.0 CPython/3.13.1 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aba62fad6afe707ba347fe4166ba5f2ed0242a81d936bf4ff4c0cd8024520b53
|
|
| MD5 |
cee07162a3ef79bcdbc69277ad5e9155
|
|
| BLAKE2b-256 |
e28227af015070dd556647ad92514c7543110cfa5e38ea45b1963dde7aaf2528
|