Name | jira-html-report JSON |
Version |
0.3.0
JSON |
| download |
home_page | None |
Summary | Generating Jira report to see issue trends. |
upload_time | 2025-01-24 06:34:31 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT |
keywords |
atlassian
jira
report
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Jira HTML Report
`jira-html-report` is a Python script designed to generate reports from Jira. This script allows you to fetch and process data from your Jira projects, providing insights and summaries that can help you manage your projects more effectively.
## Features
- HTML report with charts and table sheet
- Fetch data from Jira projects
- Generate summary reports
- Customizable report formats
- Easy to use and configure
<img src="https://github.com/freeyssu/jira-html-report/raw/main/chart.png" alt="Charts" width="1000" />
<br>
<img src="https://github.com/freeyssu/jira-html-report/raw/main/table.png" alt="Table"/>
## Requirements
- Python 3.x
- Python external packages
```
jira
plotly
pandas
jinja2
```
## Installation
- Clone the repository:
```sh
git clone https://github.com/freeyssu/jira-html-report.git
cd jira-html-report
pip install -r requirements.txt
```
- Pypi package management:
```sh
pip install jira-html-report
```
## Directory and files
```
.
├── jira_html_report/
│ ├── html_templates/
│ │ ├── chart_templates.j2
│ │ ├── report_templates.j2
│ │ └── table_templates.j2
│ ├── data.py
│ └── report.py
└── samples/
├── sample.html
├── sample.ipynb
└── sa,ple.py
```
## Usage
1. Initialize HTMLReport instance
```python
from jira_html_report import HTMLReport
html_report = HTMLReport(server='https://YOUR_JIRA_SERVER', username=USERNAME password=PASSWORD)
```
2. Query Jira items by `JQL` then generate Pandas `DataFrame`
```python
jql = 'Project = TEST AND created > -7d'
# define fields what you extract from the queried Jira items
fields_for_charts = [
'customfield_1000', # custom fields
'customfield_2000', # what you want to get
'customfield_3000', # you should put field-id
'status',
'assignee',
'reporter',
'priority',
'components'
]
fields_for_table = [
'customfield_4000', # you can add/remove any field for chart or table
'status',
'assignee'
]
# generate main DataFrame and sub DataFrames for chart.
# sub DataFrames are grouped by the selected fields and counted the rows. it has two columns (field name and Count)
chart_df, chart_sub_dfs = html_report.generate_dataframes_by_jql(jql=jql, fields=fields_for_charts, jql_search_limit=100)
table_df, table_sub_dfs = html_report.generate_dataframes_by_jql(jql=jql, fields=fields_for_table, jql_search_limit=100)
########################################################
# do something here to update the main or sub dataframes
# e.g. update column name
########################################################
```
3. Draw charts
```python
figures = {}
for field_name, sub_df in sub_dfs.items():
figures[field_name] = html_report.generate_chart_figure(
df=sub_df,
chart_type='bar',
chart_title=f'{sub_df.columns[0]} Status',
x=sub_df.columns[0],
y=sub_df.columns[1])
########################################################
# do something here to update chart properties
# figures['customfield_1000'].update_layout(...)
# figures['assignee'].update_traces(...)
# figures['field_x'] ...
########################################################
```
4. Generate HTML code blocks for chart and table sheet
```python
# generate HTML code block for charts
html_charts = {}
for field_name, figure in figures.items():
html_charts[field_name] = html_report.generate_html_chart(figure=figure, static_chart=True)
# generate HTML code block for table
html_table = html_report.generate_html_table(df=table_df)
```
5. Generate HTML report
```python
html_report = html_report.generate_html_report(html_charts=html_charts, html_table=html_table)
with open('jira_report.html', 'wb') as f:
f.write(html_report.encode())
```
## HTML template modification
There are three Jinja2 templates under `html_templates` dir to generate a HTML report. You can modify or add any HTML properties/Python vars.
1. Add/update vars or properties in Jinja2 template
```html
<!-- add <h2> tag to html_templates/report_template.j2 -->
<h2> {{ new_h2_string_in_report }} </h2>
```
2. Populate the vars
```python
html_report = html_report.generate_html_report(html_charts=html_charts, html_table=html_table, new_h2_string_in_report="ADDED NEW H2 STRING")
```
Raw data
{
"_id": null,
"home_page": null,
"name": "jira-html-report",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "atlassian, jira, report",
"author": null,
"author_email": "freeyssu <freeyssu@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/fd/09/342444d8eea90c383b8e8e5da2d9b6b9e9f28c498deca8b5d5d65a302ec3/jira_html_report-0.3.0.tar.gz",
"platform": null,
"description": "# Jira HTML Report\n\n`jira-html-report` is a Python script designed to generate reports from Jira. This script allows you to fetch and process data from your Jira projects, providing insights and summaries that can help you manage your projects more effectively.\n\n## Features\n- HTML report with charts and table sheet\n- Fetch data from Jira projects\n- Generate summary reports\n- Customizable report formats\n- Easy to use and configure\n\n<img src=\"https://github.com/freeyssu/jira-html-report/raw/main/chart.png\" alt=\"Charts\" width=\"1000\" />\n<br>\n<img src=\"https://github.com/freeyssu/jira-html-report/raw/main/table.png\" alt=\"Table\"/>\n\n## Requirements\n\n- Python 3.x\n- Python external packages\n```\njira\nplotly\npandas\njinja2\n```\n\n## Installation\n\n- Clone the repository:\n ```sh\n git clone https://github.com/freeyssu/jira-html-report.git\n cd jira-html-report\n pip install -r requirements.txt\n ```\n\n- Pypi package management:\n ```sh\n pip install jira-html-report\n ```\n\n\n## Directory and files\n```\n.\n\u251c\u2500\u2500 jira_html_report/\n\u2502 \u251c\u2500\u2500 html_templates/\n\u2502 \u2502 \u251c\u2500\u2500 chart_templates.j2\n\u2502 \u2502 \u251c\u2500\u2500 report_templates.j2\n\u2502 \u2502 \u2514\u2500\u2500 table_templates.j2\n\u2502 \u251c\u2500\u2500 data.py\n\u2502 \u2514\u2500\u2500 report.py\n\u2514\u2500\u2500 samples/\n \u251c\u2500\u2500 sample.html\n \u251c\u2500\u2500 sample.ipynb\n \u2514\u2500\u2500 sa,ple.py\n```\n\n\n## Usage\n\n1. Initialize HTMLReport instance\n```python\nfrom jira_html_report import HTMLReport\nhtml_report = HTMLReport(server='https://YOUR_JIRA_SERVER', username=USERNAME password=PASSWORD)\n```\n\n2. Query Jira items by `JQL` then generate Pandas `DataFrame`\n```python\njql = 'Project = TEST AND created > -7d'\n\n# define fields what you extract from the queried Jira items\nfields_for_charts = [\n 'customfield_1000', # custom fields\n 'customfield_2000', # what you want to get\n 'customfield_3000', # you should put field-id\n 'status',\n 'assignee',\n 'reporter',\n 'priority',\n 'components'\n]\nfields_for_table = [\n 'customfield_4000', # you can add/remove any field for chart or table\n 'status',\n 'assignee'\n]\n\n# generate main DataFrame and sub DataFrames for chart.\n# sub DataFrames are grouped by the selected fields and counted the rows. it has two columns (field name and Count)\nchart_df, chart_sub_dfs = html_report.generate_dataframes_by_jql(jql=jql, fields=fields_for_charts, jql_search_limit=100)\ntable_df, table_sub_dfs = html_report.generate_dataframes_by_jql(jql=jql, fields=fields_for_table, jql_search_limit=100)\n\n########################################################\n# do something here to update the main or sub dataframes\n# e.g. update column name\n########################################################\n```\n\n3. Draw charts\n```python\nfigures = {}\nfor field_name, sub_df in sub_dfs.items():\n figures[field_name] = html_report.generate_chart_figure(\n df=sub_df,\n chart_type='bar',\n chart_title=f'{sub_df.columns[0]} Status',\n x=sub_df.columns[0],\n y=sub_df.columns[1])\n\n########################################################\n# do something here to update chart properties\n# figures['customfield_1000'].update_layout(...)\n# figures['assignee'].update_traces(...)\n# figures['field_x'] ...\n########################################################\n```\n\n4. Generate HTML code blocks for chart and table sheet\n```python\n# generate HTML code block for charts\nhtml_charts = {}\nfor field_name, figure in figures.items():\n html_charts[field_name] = html_report.generate_html_chart(figure=figure, static_chart=True)\n\n# generate HTML code block for table\nhtml_table = html_report.generate_html_table(df=table_df)\n```\n\n5. Generate HTML report\n```python\nhtml_report = html_report.generate_html_report(html_charts=html_charts, html_table=html_table)\nwith open('jira_report.html', 'wb') as f:\n f.write(html_report.encode())\n```\n\n## HTML template modification\nThere are three Jinja2 templates under `html_templates` dir to generate a HTML report. You can modify or add any HTML properties/Python vars.\n\n1. Add/update vars or properties in Jinja2 template\n```html\n<!-- add <h2> tag to html_templates/report_template.j2 -->\n<h2> {{ new_h2_string_in_report }} </h2>\n```\n\n2. Populate the vars\n```python\nhtml_report = html_report.generate_html_report(html_charts=html_charts, html_table=html_table, new_h2_string_in_report=\"ADDED NEW H2 STRING\")\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Generating Jira report to see issue trends.",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/freeyssu/jira_html_report",
"Repository": "https://github.com/freeyssu/jira_html_report"
},
"split_keywords": [
"atlassian",
" jira",
" report"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "bdfa8ea9238a5dc868af7364c8e1879ed90732f1e38b5632f7209dfefff0a2d6",
"md5": "3cc2c13f3038f8835054b327653691e2",
"sha256": "27b7a4376c064d52e5aa38649262ba11b8a8bc04f308ffa2ef8b985b4bf8fbab"
},
"downloads": -1,
"filename": "jira_html_report-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3cc2c13f3038f8835054b327653691e2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8176,
"upload_time": "2025-01-24T06:34:29",
"upload_time_iso_8601": "2025-01-24T06:34:29.559761Z",
"url": "https://files.pythonhosted.org/packages/bd/fa/8ea9238a5dc868af7364c8e1879ed90732f1e38b5632f7209dfefff0a2d6/jira_html_report-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fd09342444d8eea90c383b8e8e5da2d9b6b9e9f28c498deca8b5d5d65a302ec3",
"md5": "f0006593f7d4d14ca7a14c53fd34c402",
"sha256": "21313cf2a08c807fdedfbdeb1b87d3235e229ddeb04ee2accb4e71d24897bfd3"
},
"downloads": -1,
"filename": "jira_html_report-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "f0006593f7d4d14ca7a14c53fd34c402",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 292018,
"upload_time": "2025-01-24T06:34:31",
"upload_time_iso_8601": "2025-01-24T06:34:31.751360Z",
"url": "https://files.pythonhosted.org/packages/fd/09/342444d8eea90c383b8e8e5da2d9b6b9e9f28c498deca8b5d5d65a302ec3/jira_html_report-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-24 06:34:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "freeyssu",
"github_project": "jira_html_report",
"github_not_found": true,
"lcname": "jira-html-report"
}