
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
exportmd
Advanced tools
Convert markdown to HTML, PDF, DOCX, and PPTX. Supports code block execution and plot rendering. Create stylish reports with charts and graphs from LLM outputs
Python package that converts markdown to HTML, PDF, DOCX, and PPTX. Supports code block execution and plot rendering. Create stylish reports with charts and graphs from LLM outputs.
pip install -r requirements.txt
pip install exportmd
import exportmd
markdown_content = """
# Analysis Report
## Data Visualization
```python
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
plt.plot(x, np.sin(x))
plt.title("Sine Wave")
plt.show()
```"""
# Method 1: Get bytes and save manually
output = exportmd.to(
markdown=markdown_content,
style='style1', # default: 'style', 'style1', 'style2', 'style3', 'custom'
format='pdf' # default: 'pdf', 'docx', 'pptx', 'html'
)
with open('output.pdf', 'wb') as f:
f.write(output)
# Method 2: Direct to file (returns None)
exportmd.to(
markdown=markdown_content,
format='pdf',
output_file='output.pdf' # File is saved directly
)
Parameters:
markdown: Input markdown textformat: Output format ('pdf', 'docx', 'pptx', 'html')output_file: Optional path to save the output (if specified, returns None)style: CSS style to use (default: 'style', 'style1', 'style2', 'style3', 'custom')custom_css: Custom CSS string when style='custom'Returns:
bytes: Converted document as bytes (or None if output_file is specified)Use standard markdown code blocks with Python:
# Print statements
print("Hello, World!")
# Matplotlib
import matplotlib.pyplot as plt
plt.plot([1, 2, 3], [1, 2, 3])
plt.show()
# Plotly
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length")
# Seaborn
import seaborn as sns
tips = sns.load_dataset('tips')
sns.boxplot(data=tips, x='day', y='total_bill')
plt.show()
Choose from three built-in styles:
style: Default-plainstyle1: Corporate finance themestyle2: Modern business themestyle3: Clean documentation themeexportmd.to(
markdown=content,
format='pdf',
style='style2'
)
Apply your own styling:
custom_css = """
body {
font-family: Arial, sans-serif;
max-width: 900px;
margin: 0 auto;
}
"""
exportmd.to(
markdown=content,
format='pdf',
style='custom',
custom_css=custom_css
)
The following libraries are available in Python code blocks:
See the examples directory for more detailed examples, including:
MIT License - see LICENSE file for details.
FAQs
Convert markdown to HTML, PDF, DOCX, and PPTX. Supports code block execution and plot rendering. Create stylish reports with charts and graphs from LLM outputs
We found that exportmd demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.