以來源為依據改寫內容的輕量 Python 輔助工具
A tiny Python helper for source-grounded content repurposing
一個小型 Python 輔助工具可在本機整理內容改寫流程,準備提示詞並打包 AI 生成的草稿,毋須 API key。提示詞要求生成 3 篇 LinkedIn 草稿、1 篇電郵草稿及 2 段短片腳本;工具只檢查 JSON 結構,不能判斷內容是否有來源支持,發布前仍須逐項核對事實。
A content-repurposing workflow has two different jobs: assembling a consistent draft pack, and deciding whether the draft actually says what the source supports. A script can help with the first job. JSON validation cannot do the second.
I put together a small Python helper and a fictional demonstration that make that boundary explicit. It runs locally with the standard library, does not need an API key, and never connects to publishing accounts.
The workflow
Start with an article or transcript you own or are authorized to process. Remove confidential or personal information first. The helper numbers the source paragraphs and prepares a prompt for an AI chat you already use:
python3 pipeline.py prepare sample-source.txt --out demo
This writes demo/prompt.txt and demo/numbered-source.txt. The prompt requests three LinkedIn drafts, one email draft and two short-video scripts. Each item has text plus source IDs.
The AI step is manual: copy the prompt to your existing chat and save the JSON-only reply. Available usage depends on that account. There is no hidden API integration.
python3 pipeline.py pack demo/response.json --out demo
The pack command checks structure and writes a readable text file. To test packaging without an AI service, use the included fictional response:
python3 pipeline.py pack sample-response.json --out demo
What validation misses
Consider this fictional source:
A weekly handoff note can include the task, owner, next action and due date. If the work is unclear, have a conversation first.
A source-grounded draft could be:
Your handoff note needs a named owner and an explicit next action. If the task is unclear, talk before sharing it.
But a draft claiming that the note increased productivity by 30% would be unsupported—even if it contains a perfectly valid source ID. The helper does not claim to catch that semantic error.
Before publishing, compare every factual claim to the original. Remove invented metrics and testimonials, check the audience and call to action, and give each draft a distinct point. Have the content owner approve the result.
Try the example
Repository, helper and fictional source/output files.
The example is a demonstration, not a client case study or evidence of engagement, time saved or sales.
Disclosure: this article and demonstration were created with AI assistance. I operate the optional B2B repurposing service linked here. The $50 pilot provides the six written drafts above, up to 1,000 delivery words from one source of up to 2,000 words, with a three-day delivery window after complete requirements and one revision. It does not include video production or automatic publishing. The local helper remains available to try without purchasing the service.
來源:DEV Community · dev.to