A Python package for creating multi-format reports with sections, text, images, plots, tables, and multiple pages
Project description
Upsurge
A Python library for creating multi-format reports with support for sections, text, images, plots, tables, and multiple pages with internal links.
Features
- Multi-page Reports: Create reports with multiple pages and navigation
- Rich Content: Support for text, images, matplotlib plots, and pandas tables
- Multiple Formats: Export to Markdown, HTML, and PDF
- Internal Linking: Link between pages within your report
- Customizable: Extensible design with custom CSS support
Installation
pip install upsurge
For development:
pip install upsurge[dev]
Quick Start
from upsurge import Report, Page, Text, Section
from upsurge.publishers import HTMLPublisher
# Create a report
report = Report(
title="My Report",
author="John Doe",
description="A sample report"
)
# Add a page
page = Page(
id="introduction",
title="Introduction"
)
# Add content
page.add_content(Text(content="Welcome to my report!"))
# Add sections
section = Section(title="Background", level=2)
section.add_content(Text(content="Some background information..."))
page.add_section(section)
# Add page to report
report.add_page(page)
# Export to HTML
publisher = HTMLPublisher()
publisher.publish(report, "my_report.html")
Working with Tables
import pandas as pd
from upsurge import Table
df = pd.DataFrame({
"Name": ["Alice", "Bob", "Charlie"],
"Age": [25, 30, 35],
})
table = Table(
data=df.values.tolist(),
headers=list(df.columns),
caption="Employee List"
)
Working with Plots
import matplotlib.pyplot as plt
from upsurge import Plot
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 4, 9])
plot = Plot(
figure=fig,
caption="A quadratic curve"
)
Export Formats
Markdown
from upsurge.publishers import MarkdownPublisher
publisher = MarkdownPublisher()
publisher.publish(report, "report.md")
HTML
from upsurge.publishers import HTMLPublisher
publisher = HTMLPublisher()
publisher.publish(report, "report.html")
from upsurge.publishers import PDFPublisher
publisher = PDFPublisher()
publisher.publish(report, "report.pdf")
Development
Install development dependencies:
pip install upsurge[dev]
Run tests:
pytest
Run linter:
ruff check src/
Build documentation:
sphinx-build -b html docs dist/docs
License
MIT License - see LICENSE file for details.
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 upsurge-0.1.0.tar.gz.
File metadata
- Download URL: upsurge-0.1.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eca558dc6e584a61d49a36959884bec178863c9c35cc8d4cace0ffde28fcb51
|
|
| MD5 |
360d349c6928b3ee87dae694b00f3069
|
|
| BLAKE2b-256 |
0f72942c171c97fc38c1981b253960cea4fec203db320f4dbdc1524fe88f4e7a
|
Provenance
The following attestation bundles were made for upsurge-0.1.0.tar.gz:
Publisher:
publish.yml on CaspianDataLabs/Upsurge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
upsurge-0.1.0.tar.gz -
Subject digest:
8eca558dc6e584a61d49a36959884bec178863c9c35cc8d4cace0ffde28fcb51 - Sigstore transparency entry: 1201656657
- Sigstore integration time:
-
Permalink:
CaspianDataLabs/Upsurge@2b8cd1a1ac994e8dd8a1494615c42e56b61539b8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CaspianDataLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2b8cd1a1ac994e8dd8a1494615c42e56b61539b8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file upsurge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: upsurge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7eb2dacab7e710ed185b06864639a503ea877257be1a273f5eff569751719ae
|
|
| MD5 |
0cd4f9acec4b3ee2a74c1958d8d12233
|
|
| BLAKE2b-256 |
f9e8a1a6733b6245b3f382f1c1b459015bbee3991fcded8837b6461dbeabdea4
|
Provenance
The following attestation bundles were made for upsurge-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on CaspianDataLabs/Upsurge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
upsurge-0.1.0-py3-none-any.whl -
Subject digest:
e7eb2dacab7e710ed185b06864639a503ea877257be1a273f5eff569751719ae - Sigstore transparency entry: 1201656684
- Sigstore integration time:
-
Permalink:
CaspianDataLabs/Upsurge@2b8cd1a1ac994e8dd8a1494615c42e56b61539b8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CaspianDataLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2b8cd1a1ac994e8dd8a1494615c42e56b61539b8 -
Trigger Event:
push
-
Statement type: