PyBloqs is a flexible framework for visualizing data and automated creation of reports.
It works with Pandas, matplotlib and highcharts. PyBloqs creates atomic blocks containing text, tables (from Pandas DataFrame), plots (matplotlib or highcharts) or images. All blocks can be styled with CSS. Each block can be created and displayed separately for fast development turnover. Lists of blocks can be stacked together to form reports. Reports can be displayed as HTML in the browser or exported in a variety of formats (including HTML, PDF, SVG, PNG).
See the documentation for installation instructions.
from pybloqs import Block, HStack, VStack
import pandas as pd
from matplotlib import pyplot as plt
text_block = Block('This is a text block', styles={'text-align':'center', 'color':'blue'})
text_block.show()
df = pd.DataFrame([[1., 2.],[3.,4.]], columns =['a', 'b'])
table_block = Block(df)
table_block.show()
plot_block = Block(plt.plot(df['a'], df['b']))
plot_block.show()
plot_and_table = HStack([plot_block, table_block])
report = VStack([text_block, plot_and_table])
report.show()
report.save('report.pdf')
You can specify per-user default parameters in a yaml-formatted file ~/.pybloqs.cfg. This config file allows you to setup a call setup and login sequence against an smtplib.SMTP object. The following works for Google gmail - more detailshere.
smtp_kwargs:
host: smtp.gmail.com
port: 587
smtp_pre_login_calls:
- !!python/tuple
- ehlo
- {}
- !!python/tuple
- starttls
- {}
- !!python/tuple
- ehlo
- {}
smtp_login:
user: me@gmail.com
password: a_secret
public_dir: /tmp
tmp_html_dir: /tmp
user_email_address: me@gmail.com
PyBloqs works with:
- matplotlib
- Pandas
- html5lib
- lxml
- jinja2
- markdown
- beautifulsoup4
- docutils
PyBloqs has been under active development at Man AHL since 2013.
Original concept and implementation: Tom Farnbauer
Contributors:
- Dominik Christ
- Barry Fitzgerald
- Wilfred Hughes
- James Munro
- Bogdan Cozmaciuc
- Dave Jepson
- Jason Matthews
- Rhodri Richards
- Doug Bruce
- Jonathan Nye
- Matthew Dodds
- Han Wei Teo
- Manjunath Goudreddy
- Edwin Flores
- ... and many others ...
Contributions welcome!
PyBloqs is licensed under the GNU LGPL v2.1. A copy of which is included in LICENSE