Coder Social home page Coder Social logo

domvwt / esparto Goto Github PK

View Code? Open in Web Editor NEW
85.0 1.0 7.0 21.12 MB

Data driven report builder for the Python data ecosystem.

License: MIT License

Makefile 2.27% Python 91.13% CSS 2.55% Jinja 3.06% JavaScript 0.99%
python html bootstrap pandas bokeh plotly pdf data-analysis dashboards

esparto's Introduction





esparto is a Python library for building data driven reports with content from popular analytics packages.

Main Features

Basic Usage

import esparto as es

# Do some analysis
pandas_df = ...
plot_fig = ...
markdown_str = ...

# Create a page
page = es.Page(title="My Report")

# Add content
page["Data Analysis"]["Plot"] = plot_fig
page["Data Analysis"]["Data"] = pandas_df
page["Data Analysis"]["Notes"] = markdown_str

# Save to HTML or PDF
page.save_html("my-report.html")
page.save_pdf("my-report.pdf")

Installation

esparto is available from PyPI and Conda:

pip install esparto
conda install esparto -c conda-forge
poetry add esparto

Dependencies

Optional

License

MIT

Documentation

User guides, documentation, and examples are available on the project home page.

Contributions, Issues, and Requests

Feedback and contributions are welcome - please raise an issue or pull request on GitHub.

Examples

Iris Report - Webpage | PDF | Notebook


example page

esparto's People

Contributors

dependabot-preview[bot] avatar domvwt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

esparto's Issues

Cannot export to html when matplotlib axis is negative.

  • esparto version: 4.1.0
  • Python version: 3.9.7
  • Operating System: Windows 10

Description

Cannot export to html when matplotlib axis is negative. I get the error:

UnicodeEncodeError: 'charmap' codec can't encode character '\u2212' in position 13531 character maps to

What I Did

import unittest
import matplotlib.pyplot as plt
import esparto

class TestNegativeChar(unittest.TestCase):
    
    def test_no_negative_char(self):
        
        fig, ax = plt.subplots()
        x = [1,2,3,4,5]
        y = [1,0.5, 0, 1, 2]
        ax.plot(x, y)
        
        page = esparto.Page(title="Test")
        page["Plot"] = fig
        page.save_html("test-fig.html")
    
    def test_negative_char(self):
        """This fails
        
        UnicodeEncodeError: 'charmap' codec can't encode character '\u2212' in position 13531: character maps to <undefined>
        """
        
        fig, ax = plt.subplots()
        x = [1,2,3,4,5]
        y = [-1,-0.5, 0, 1, 2]
        ax.plot(x, y)
        
        page = esparto.Page(title="Test")
        page["Plot"] = fig
        page.save_html("test-fig.html")

PDF output should be supported

This has been requested by prospective users - integration with Weasyprint is 80% complete. Only unit tests are outstanding.

save_pdf() doesn't include images from Markdown files

  • esparto version: 2.0.0
  • Python version: 3.8
  • Operating System: Debian Bullseye, WSL

Description

I'm using your library to generate some very simple pdf documentation using existing markdown files. Some of these markdown files have included images, the images are properly displayed when I do page.save_html(), but when I do page.save_pdf() only the image description (and not the image itself) is included

I expected the pdf output to include the images just as the html output does.

PDF Export features: TOC with page numbers, page number in footer

  • esparto version: 4.3.1
  • Python version: 3.11
  • Operating System: Linux

Description

I really enjoy the simplicity of this project but I am wondering if the generated reports support advanced features:

  1. The TOC is included into the PDF and clickable, great. For the PDF-Export it would be great to have page numbers for the parts in the table of content

  2. Is it possible to include the current page number or maybe even the current section into a page footer? Again, the topic is a PDF output topic I assume.

Thank you for building this project.
As I said I really like working with it and I'm trying to understand if there are more usage examples somewhere in order to bring it into more use here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.