Skip to main content

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")

PDF

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

upsurge-0.1.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

upsurge-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

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

Hashes for upsurge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8eca558dc6e584a61d49a36959884bec178863c9c35cc8d4cace0ffde28fcb51
MD5 360d349c6928b3ee87dae694b00f3069
BLAKE2b-256 0f72942c171c97fc38c1981b253960cea4fec203db320f4dbdc1524fe88f4e7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for upsurge-0.1.0.tar.gz:

Publisher: publish.yml on CaspianDataLabs/Upsurge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for upsurge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7eb2dacab7e710ed185b06864639a503ea877257be1a273f5eff569751719ae
MD5 0cd4f9acec4b3ee2a74c1958d8d12233
BLAKE2b-256 f9e8a1a6733b6245b3f382f1c1b459015bbee3991fcded8837b6461dbeabdea4

See more details on using hashes here.

Provenance

The following attestation bundles were made for upsurge-0.1.0-py3-none-any.whl:

Publisher: publish.yml on CaspianDataLabs/Upsurge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page