开发者

Python based web reporting tool? [closed]

开发者 https://www.devze.com 2022-12-16 04:28 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 3 months ago.

Improve this question

I have a question for those of you doing web work with python. Is anyone f开发者_开发百科amiliar with a python based reporting tool? I am about to start on a pretty big web app and will need the ability to do some end user reporting (invoices, revenue reports, etc). It can be an existing django app or anything python based so I can hook into it.


ReportLab

Welcome to the ReportLab Open Source site. ReportLab is a library for programatically creating PDF documents. It's a fast, flexible, cross platform solution written in Python.


Or go a little higher level than reportlab: xhtml2pdf - now WeasyPrint (built on top of reportlab)

From the website:

  • Translates HTML and CSS input into PDF files
  • Is written pure Python and therefore platform independent
  • Supports document specifics like columns, headers, footers, page numbers, custom Postscript and TrueType fonts, etc.
  • Best support for frameworks like Django, Turbogears, CherryPy, Pylons, WSGI
  • Simple integration into Python programms
  • Also available as stand alone command line tool for Windows, MacOS X and Linux


Most reporting tools are stuck in the '80s: a time when you 'painted' a report intended to be printed that completely lacked integration with other reports.

Sometimes we still need that. If you need to print an invoice, you're pretty much stuck with that kind of functionality. But in general, most reporting these days consists of multiple queries/charts/graphs/tables per page with drill-down built directly into it.

If you've got enough of a need go with an OLAP tool - then you don't even code the reports, your users (theoretically) can. If not, I've seldom seen a scenario in which a "reporting tool" was better than using something like Chart Director with a language like php, perl, python, ruby, etc.


Try to have look at the Cubes - Light-weight OLAP framework for Python. It is just partial solution for your problem, but I think it might help.

  • Sources at github
  • Documentation
  • Blog with tutorials

You can either use Python to do OLAP/aggregated browsing or you can run an OLAP HTTP Server (called Slicer). Here is an example using HTTP Server: Open Public Procurements reporting. The front-end is PHP which accesses Slicer server through HTTP. Example of server can be found here with documentation for the server can be found here.

Currently the framework provides SQL backend using SQLAlchemy, so you can use any DB that can SQLAlchemy has engine for.

Reports in form of charts, tables & stuff, including JS front-end framework are planned. Just wanted to help at least with lower OLAP layer.

Let me know if you have any questions, I am the author.


Also have a look at myDBR a tool that allows you to define your reports in the database (using stored procedures) and then takes care of the layout and formatting of the data.

Even though myDBR is a PHP application, it does not require any PHP coding, just install the application and embed it as iframe in your own app.


I've been working on a recent addition to this. It allows you to create HTML reports from Python which you can share as standalone HTML files. This means you can have interactive components - such as table viewers and interactive plots (which have become a lot more popular since this question was originally posed).

Currently it supports pandas DataFrames, Bokeh, Plotly, Altair, JSON, and Markdown components.

For instance:

import altair as alt
import pandas as pd
import datapane as dp

df = pd.read_csv('https://query1.finance.yahoo.com/v7/finance/download/GOOG?period1=1553600505&period2=1585222905&interval=1d&events=history')
chart = alt.Chart(df).encode(x='Date', y='High', y2='Low').mark_area(opacity=0.5).interactive()

dp.Report(dp.Table(df['High']), dp.Plot(chart)).save(path='stock_analysis.html')

It's still early, but check it out: https://docs.datapane.com


I was doing some research and found about awe. It runs a small webserver which can do realtime updates on a page and allows for more complicated report layouts.

It has documentation and examples and can give you something up and running, quickly.

0

精彩评论

暂无评论...
验证码 换一张
取 消