Core API Reference¶
This page documents the core modules of Medium Converter.
Article Model¶
medium_converter.core.models.Article
¶
A Medium article.
Fetcher¶
medium_converter.core.fetcher.fetch_article(url, cookies=None)
async
¶
Fetch a Medium article's HTML content.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
The URL of the Medium article
TYPE:
|
cookies
|
Optional cookies for authentication
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
HTML content of the article |
Source code in medium_converter/core/fetcher.py
Parser¶
medium_converter.core.parser.parse_article(html)
¶
Parse a Medium article's HTML content.
| PARAMETER | DESCRIPTION |
|---|---|
html
|
The HTML content of the Medium article
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Article
|
Structured Article object |
Source code in medium_converter/core/parser.py
Authentication¶
medium_converter.core.auth.get_medium_cookies()
¶
Extract Medium cookies from the user's browser.
| RETURNS | DESCRIPTION |
|---|---|
dict[str, str]
|
Dict of cookies for Medium domain |