基于 Python 的网络报告工具?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2021252/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Python based web reporting tool?
提问by Mark Freeman
I have a question for those of you doing web work with python. Is anyone familiar 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. Thanks!
我有一个问题要问那些使用 Python 进行 Web 工作的人。有人熟悉基于python的报告工具吗?我即将开始一个相当大的网络应用程序,需要能够做一些最终用户报告(发票、收入报告等)。它可以是现有的 django 应用程序或任何基于 python 的应用程序,因此我可以连接到它。谢谢!
Mark
标记
回答by Matthew Talbert
回答by Will Hardy
Or go a little higher level than reportlab: xhtml2pdf- now WeasyPrint(built on top of reportlab)
或者比reportlab高一点: xhtml2pdf- 现在WeasyPrint(建立在 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
- 将 HTML 和 CSS 输入转换为 PDF 文件
- 是纯 Python 编写的,因此与平台无关
- 支持文档细节,如列、页眉、页脚、页码、自定义 Postscript 和 TrueType 字体等。
- 对 Django、Turbogears、CherryPy、Pylons、WSGI 等框架的最佳支持
- 简单集成到 Python 程序中
- 也可用作 Windows、MacOS X 和 Linux 的独立命令行工具
回答by Stiivi
Try to have look at the Cubes - Light-weight OLAPframework for Python. It is just partial solution for your problem, but I think it might help.
尝试查看Cubes -Python 的轻量级 OLAP框架。这只是您问题的部分解决方案,但我认为它可能会有所帮助。
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 Procurementsreporting. The front-end is PHP which accesses Slicer server through HTTP. Example of server can be found herewith documentation for the server can be found here.
您可以使用 Python 进行 OLAP/聚合浏览,也可以运行 OLAP HTTP 服务器(称为切片器)。以下是使用 HTTP Server 的示例:开放公共采购报告。前端是 PHP,通过 HTTP 访问 Slicer 服务器。服务器的示例可以在这里找到,服务器的文档可以在这里找到。
Currently the framework provides SQL backend using SQLAlchemy, so you can use any DB that can SQLAlchemy has engine for.
目前该框架使用 SQLAlchemy 提供 SQL 后端,因此您可以使用 SQLAlchemy 具有引擎的任何数据库。
Reports in form of charts, tables & stuff, including JS front-end framework are planned. Just wanted to help at least with lower OLAP layer.
计划以图表、表格和东西形式的报告,包括 JS 前端框架。只是想至少在较低的 OLAP 层上提供帮助。
Let me know if you have any questions, I am the author.
如果您有任何问题,请告诉我,我是作者。
回答by KenFar
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.
大多数报告工具都停留在 80 年代:您“绘制”了一份打算打印的报告,但完全缺乏与其他报告的集成。
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.
如果您有足够的需求使用 OLAP 工具 - 那么您甚至不需要编写报告,您的用户(理论上)可以。如果没有,我很少看到“报告工具”比使用诸如 php、perl、python、ruby 等语言的 Chart Director 之类的东西更好的场景。
回答by Wolfgang
Also have a look at myDBRa 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.
还可以查看myDBR一个工具,它允许您在数据库中定义您的报告(使用存储过程),然后负责数据的布局和格式设置。
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.
尽管 myDBR 是一个 PHP 应用程序,但它不需要任何 PHP 编码,只需安装该应用程序并将其作为 iframe 嵌入您自己的应用程序中。