Need help with tomd?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

gaojiuli
498 Stars 72 Forks GNU General Public License v3.0 49 Commits 18 Opened issues

Description

Convert HTML to Markdown.

Services available

!
?

Need anything else?

Contributors list

# 23,043
bittorr...
Jupyter...
python3
Markdow...
25 commits
# 239,552
Shell
HTML
Markdow...
eye-tra...
9 commits
# 274,672
lilypon...
Markdow...
6 commits

tomd

[License](https://pypi.python.org/pypi/tomd/) [Pypi](https://pypi.python.org/pypi/tomd/) [Python](https://pypi.python.org/pypi/tomd/)

When crawling online articles such as news, blogs, etc. I want to save them in markdown files but not databases. Tomd has the ability of converting a HTML that converted from markdown. If a HTML can't be described by markdown, tomd can't convert it right. Tomd is a python tool.

Road map

  • [x] Basic support
  • [ ] Full support(Nested list)
  • [ ] Command line tool

Installation

pip install tomd

Getting Started

Input

import tomd

tomd.Tomd('

h1

').markdown

or

tomd.convert('

h1

')

Output

# h1

Usage

from tomd import Tomd


html="""

h1

h2

h3

h4

h5
h6

paragraph link img

  • 1
  • 2
  • 3
  1. 1
  2. 2
  3. 3
blockquote

inline code

block code

del bold italic bold italic


th1 th2
td td
td td
"""

Tomd(html).markdown

Result

# h1

h2

h3

h4

h5
h6

paragraph link img

  • 1
  • 2
  • 3
  1. 1
  2. 2
  3. 3

> blockquote

inline code

block code

del bold italic bold italic


|th1|th2 |------ |td|td |td|td

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.