A useful simple to use tool to turn your sql query into a beautiful report html table
Project description
This is easy to use tool for generating html table from sql query.
the package contains only one function named "generateFromSql" with 8 arguments :
- session : SQLAlchemy session
- title : the title of the report that will be shown on top of table
- sqltext : the sql query
- footerCols : a list of columns name that you want to have Sum of values on footer . Example : ['amount','price']
- direction (default = "ltr") : indicates direction of the report page. "ltr"- Left to Right , "rtl" - Right to Left
- font (default = "Tahoma") : font of title and table contents
- totalText (default = "Total") : title of footer row that will be the put below the first column.
- rowIndex (default = False) : indicates whether the table should have index column or not.
- headerRowColor (default = '#eeeeee') : the header (title) row background color.
- evenRowColor (default = '#ffffff') : the even rows background color.
- oddRowColor (default = '#ffffff') : the odd rows background color.
Installation
To install flask_sqlalchemy using pip type:
pip install flask-sqlalchemy-report
Usage :
from flask_sqlalchemy_report import Reporter
@app.route('/listOfPersons', methods=['GET'])
def listOfPersons():
return Reporter.generateFromSql(db.session, "Employee List","SELECT FirstName as 'First Name', LastName as 'Last Name', phone as 'Phone Number', salary as 'Salary' FROM persons", ['Salary'], "rtl", "Arial", "Total Salary", True,'#ffeeee','#ffeeff','#ffffff')
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
Built Distribution
Close
Hashes for flask_sqlalchemy_report-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b4a86f872d0a23a2f4e675e3f22115384fad6967e2e4cbd18a370a67bdeb7e0 |
|
MD5 | 4bd063748ec0196e82863c22905a106e |
|
BLAKE2b-256 | 0bc6f929c8ce302f9ee161488360bf026f8e06f8ec746f65917836ad3ed095a9 |
Close
Hashes for flask_sqlalchemy_report-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c74593ba8f66103b78dcd335100d6f23dce43604ab9e4c42c8fee78afb99e739 |
|
MD5 | 077c0cced234f220a6c290423a18b8ff |
|
BLAKE2b-256 | a52c435b3301683c6fb22b2266109939c3174f519f4bbffa3d1e60bcda851b43 |