You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

mdka

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdka

HTML to Markdown converter

1.4.6
PyPI
Maintainers
1

mdka: Bindings for Python

Summary

HTML to Markdown (MD) converter written in Rust.

A kind of text manipulator named mdka. "ka" means "化 (か)" pointing to conversion.

Bindings for Python are supported. Python scripts can import this Rust library to use the functions.

Install

$ pip install mdka

Code examples

awesome.py

Convert from HTML text

from mdka import md_from_html

print(md_from_html("<p>Hello, world.</p>"))
# Hello, world.
# 
Paramter(s)
positionname / description
1html_text
Return

String

Error(s)

(None)

Convert from HTML file

from mdka import md_from_file

print(md_from_file("tests/fixtures/simple-01.html"))
# Hello, world.
# 
Paramter(s)
positionname / description
1html_filepath
Return

String

Error(s)

File I/O

Convert from HTML text and write the result to file

from mdka import md_from_html_to_file

md_from_html_to_file("<p>Hello, world.</p>", "tests/tmp/out.md", False)
Paramter(s)
positionname / description
1html_text
2markdown_filepath
3overwrites : Overwrite if Markdown file exists.
Return

(None)

Error(s)

File I/O

Convert from HTML file and write the result to file

from mdka import md_from_file_to_file

md_from_file_to_file("tests/fixtures/simple-01.html", "tests/tmp/out.md", False)
Paramter(s)
positionname / description
1html_filepath
2markdown_filepath
3overwrites : Overwrite if Markdown file exists.
Return

(None)

Error(s)

File I/O

Keywords

html

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts