Skip to main content

Fetch WeChat Official Account articles and convert them to Markdown

Project description

wechat-article-to-markdown

Fetch WeChat Official Account articles and convert them to clean Markdown.

English | 中文

Features

  • Anti-detection fetching with Camoufox
  • Extract article metadata (title, account name, publish time, source URL)
  • Convert WeChat article HTML to Markdown
  • Download article images to local images/ and rewrite links
  • Handle WeChat code-snippet blocks with language fences

Installation

# Recommended: pipx
pipx install wechat-article-to-markdown

# Or: uv tool
uv tool install wechat-article-to-markdown

Or from source:

git clone git@github.com:jackwener/wechat-article-to-markdown.git
cd wechat-article-to-markdown
uv sync

Usage

# Installed CLI
wechat-article-to-markdown "https://mp.weixin.qq.com/s/xxxxxxxx"

# Run in repo with uv
uv run wechat-article-to-markdown "https://mp.weixin.qq.com/s/xxxxxxxx"

# Backward-compatible local entry
uv run main.py "https://mp.weixin.qq.com/s/xxxxxxxx"

Output structure:

output/
└── <article-title>/
    ├── <article-title>.md
    └── images/
        ├── img_001.png
        ├── img_002.png
        └── ...

Use as AI Agent Skill

This project ships with SKILL.md, so AI agents can discover and use this tool workflow.

Claude Code / Antigravity

# Clone into your project's skills directory
mkdir -p .agents/skills
git clone git@github.com:jackwener/wechat-article-to-markdown.git \
  .agents/skills/wechat-article-to-markdown

# Or copy SKILL.md only
curl -o .agents/skills/wechat-article-to-markdown/SKILL.md \
  https://raw.githubusercontent.com/jackwener/wechat-article-to-markdown/main/SKILL.md

OpenClaw / ClawHub

Officially supports OpenClaw and ClawHub:

clawhub install wechat-article-to-markdown

PyPI Publishing (GitHub Actions)

Repository: jackwener/wechat-article-to-markdown Workflow: .github/workflows/publish.yml Environment: pypi

publish.yml triggers on v* tags and workflow_dispatch, builds with uv build, then publishes with trusted publishing (id-token: write).


功能特性

  • 使用 Camoufox 进行反检测抓取
  • 提取标题、公众号名称、发布时间、原文链接
  • 将微信公众号文章 HTML 转换为 Markdown
  • 下载图片到本地 images/ 并自动替换链接
  • 处理微信 code-snippet 代码块并保留语言标识

安装

# 推荐:pipx
pipx install wechat-article-to-markdown

# 或者:uv tool
uv tool install wechat-article-to-markdown

使用示例

wechat-article-to-markdown "https://mp.weixin.qq.com/s/xxxxxxxx"

作为 AI Agent Skill 使用

项目自带 SKILL.md,可供支持 .agents/skills/ 约定的 Agent 自动发现。

OpenClaw / ClawHub

clawhub install wechat-article-to-markdown

License

MIT

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

wechat_article_to_markdown-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wechat_article_to_markdown-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file wechat_article_to_markdown-0.1.0.tar.gz.

File metadata

File hashes

Hashes for wechat_article_to_markdown-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f750dfd36306ddf197363517954312f08e6da71e7e26b393a3ba36aa4a51521
MD5 bf39398e218cdd8fdf9dea5136d503d9
BLAKE2b-256 9ed17b1626c2533e122064c49ffe588786ee3179b0971cb703c2efaf29fbc123

See more details on using hashes here.

Provenance

The following attestation bundles were made for wechat_article_to_markdown-0.1.0.tar.gz:

Publisher: publish.yml on jackwener/wechat-article-to-markdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wechat_article_to_markdown-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wechat_article_to_markdown-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85e773f489b0d65872f7958152bbd5b2e3761f0b12262b7d176257bb1676457d
MD5 edc1d40c6b65d0fc0e55c8a015e4aa1a
BLAKE2b-256 2700e6cb084dc170039460e74b4added5a34ecd4264dacc8bbaa078859984fe4

See more details on using hashes here.

Provenance

The following attestation bundles were made for wechat_article_to_markdown-0.1.0-py3-none-any.whl:

Publisher: publish.yml on jackwener/wechat-article-to-markdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page