Convert Medium articles into paste-ready X (Twitter) Articles
Project description
medium2x
Convert a Medium article into a paste-ready X (Twitter) Article — keeping your headings, bold, italics, lists, links, and images, with minimal manual effort.
Why
X has no API for posting rich Articles, and pasting a Medium post into X's Article composer normally strips all formatting and drops every image. medium2x does the tedious part for you: it fetches your Medium article, cleans the HTML, downloads the images, and produces a folder you can paste straight into X's Article composer with formatting intact.
You stay in control of the final publish — the tool gets you to one paste and a few image drags, instead of reformatting an entire article by hand.
Install
# with pip
pip install medium2x
# as an isolated CLI tool (recommended)
pipx install medium2x
# or, with uv:
uv tool install medium2x
# run once without installing
uvx medium2x
Usage
# interactive: prompts for your Medium username, then shows a picker
medium2x
# non-interactive: pick the Nth article from the feed (1-based)
medium2x --user @yourname --index 1
# convert an older article not in the latest-10 feed
medium2x --url https://medium.com/@yourname/your-article-slug-abc123
# convert a locally-saved page (workaround for member-only / paywalled posts)
medium2x --html-file saved-article.html
# choose where output goes (default: ./out)
medium2x --user @yourname --index 1 --out ./export
Each run writes a self-contained folder:
out/<article-slug>/
├── article.html # open in a browser, Ctrl+A, Ctrl+C, paste into X
├── images/ # 01.jpg, 02.png, ... in reading order
└── HOW-TO.txt # the paste + drag steps
Publishing on X
- Open
article.htmlin your browser. Ctrl+A, thenCtrl+C(the browser copies it as rich text).- On x.com: Profile → Articles → Write Article, click the body,
Ctrl+V. Headings, bold, italics, lists, blockquotes, and links carry over. - For each
⟦ IMAGE NN ⟧marker, upload the matching file fromimages/, then delete the marker. - Review and Publish.
How it works
Medium RSS / URL -> clean & normalize HTML -> download images + insert markers -> article.html
Formatting survives because HTML is the carrier of rich text on the web clipboard: when your browser copies a rendered page, it places an HTML representation on the clipboard, and X's Article composer rebuilds the formatting from it. Markdown and plain text do not survive this path — which is why medium2x produces an HTML file rather than text.
Limitations
- Medium RSS returns only your latest 10 posts. Use
--urlfor older articles. - Member-only (paywalled) posts expose only a preview to logged-out fetchers. Save the page from your browser while logged in and use
--html-file. - Images are dragged/uploaded manually — X requires real uploads; images can't be pasted through the clipboard.
License
MIT
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
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 medium2x-0.1.0.tar.gz.
File metadata
- Download URL: medium2x-0.1.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cebbaf1720ef6b3b5ed044efc0c81becf7fce922d037e5cefa85d28c35226300
|
|
| MD5 |
2678ef38a33a3a5fa0c346892b8db54d
|
|
| BLAKE2b-256 |
38151a244b7e8b719d3e2b520185f8971bc65a652a8b01cfec38c300337e7dae
|
File details
Details for the file medium2x-0.1.0-py3-none-any.whl.
File metadata
- Download URL: medium2x-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4c247c946edd1db50fb4db2df682ec716b693711b1062f54c062249abda4330
|
|
| MD5 |
671539e38f549069d6572bf16aab01de
|
|
| BLAKE2b-256 |
b4f31a7b9381ff6e6e992857450f5b72c181a686b217cd6abcccadcac7269e26
|