{"id":17703795,"url":"https://github.com/birddevelper/flask_sqlalchemy_report","last_synced_at":"2025-03-13T07:32:08.015Z","repository":{"id":57430761,"uuid":"355907091","full_name":"birddevelper/Flask_SqlAlchemy_Report","owner":"birddevelper","description":"A useful simple to use utility to turn your sql query into a beautiful report HTML table","archived":false,"fork":false,"pushed_at":"2023-12-04T16:15:36.000Z","size":45,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T19:07:08.529Z","etag":null,"topics":["flask","flask-sqlalchemy","html","python","report","sql","sql-query","sqlalchemy","table"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/birddevelper.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-08T12:54:57.000Z","updated_at":"2024-12-14T17:22:13.000Z","dependencies_parsed_at":"2023-12-04T17:44:38.423Z","dependency_job_id":null,"html_url":"https://github.com/birddevelper/Flask_SqlAlchemy_Report","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.2142857142857143,"last_synced_commit":"cf60be20e06e8ebc83a7dd939192d1b9b20e3ee6"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birddevelper%2FFlask_SqlAlchemy_Report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birddevelper%2FFlask_SqlAlchemy_Report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birddevelper%2FFlask_SqlAlchemy_Report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birddevelper%2FFlask_SqlAlchemy_Report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/birddevelper","download_url":"https://codeload.github.com/birddevelper/Flask_SqlAlchemy_Report/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243361383,"owners_count":20278560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","flask-sqlalchemy","html","python","report","sql","sql-query","sqlalchemy","table"],"created_at":"2024-10-24T21:05:59.035Z","updated_at":"2025-03-13T07:32:07.592Z","avatar_url":"https://github.com/birddevelper.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Downloads](https://static.pepy.tech/personalized-badge/flask-sqlalchemy-report?period=total\u0026units=international_system\u0026left_color=black\u0026right_color=green\u0026left_text=Downloads)](https://pepy.tech/project/flask-sqlalchemy-report)\n\n### Flask_SqlAlchemy_Report is an easy to use tool for generating html table from sql query.\n\nThe package contains single function named \"generateFromSql\" which accepts 11 arguments :\n\n* session : SQLAlchemy session\n* title : The title of the report that will be shown on top of table\n* sqltext : The sql select query to retrieve data\n* footerCols : A list of columns name that you want to have Sum of values on footer . Example : ['amount','price']\n* direction (default = \"ltr\") : Indicates direction of the report page.  \"ltr\"- Left to Right , \"rtl\" -  Right to Left\n* font (default = \"Tahoma\") : Font of title and table contents\n* totalText (default = \"Total\") : Title of footer row that will be the put below the first column.\n* rowIndex (default = False) : Indicates whether the table should have index column or not.\n* headerRowColor (default = '#eeeeee') :  The header (title) row background color.\n* evenRowColor (default = '#ffffff') :  The even rows background color.\n* oddRowColor (default = '#ffffff') :  The odd rows background color.\n\n\n\n## Installation\nTo install flask_sqlalchemy using pip :\n\n```shell\npip install flask-sqlalchemy-report\n```\n\n## Usage :\n\n\n```python\nfrom flask_sqlalchemy_report import Reporter \n\n@app.route('/listOfPersons', methods=['GET'])\ndef listOfPersons():\n  reportTitle = \"Employee List\"\n  sqlQuery = \"SELECT FirstName as 'First Name', LastName as 'Last Name', phone as 'Phone Number', salary as 'Salary' FROM persons\"\n  columnsToBeSummarized = ['Salary']\n  fontName = \"Arial\"\n  headerRowBackgroundColor = '#ffeeee'\n  evenRowsBackgroundColor = '#ffeeff'\n  oddRowsBackgroundColor = '#ffffff'\n  rowIndexVisibility = True\n  footerSummaryTitle = \"Total Salary\"\n  return Reporter.generateFromSql(db.session, reportTitle, sqlQuery, columnsToBeSummarized, \n                                  \"ltr\", fontName, footerSummaryTitle, rowIndexVisibility,\n                                  headerRowBackgroundColor, evenRowsBackgroundColor, oddRowsBackgroundColor\n                                  )\n   \n ```\n\n## See More \n[Read more about flask_sqlalchemy_report here](https://mshaeri.com/blog/generate-html-table-from-sql-query-in-flask/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirddevelper%2Fflask_sqlalchemy_report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbirddevelper%2Fflask_sqlalchemy_report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirddevelper%2Fflask_sqlalchemy_report/lists"}