html-to-adf 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 actes2
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: html-to-adf
3
+ Version: 0.1.0
4
+ Summary: Convert HTML to Atlassian Document Format (ADF) for Jira and Confluence.
5
+ Author-email: Avery Tomlin <actesbusiness@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/actes2/html-to-adf
8
+ Project-URL: Documentation, https://github.com/actes2/html-to-adf#readme
9
+ Project-URL: Issues, https://github.com/actes2/html-to-adf/issues
10
+ Keywords: atlassian,jira,adf,html,converter
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: beautifulsoup4
15
+ Dynamic: license-file
16
+
17
+ # html-to-adf - Convert HTML to ADF (Atlassian Document Format)
18
+
19
+ ## What is this?
20
+ This is a rudimentary python helper module, dedicated to producing Jira/Confluence ready ADF out of incoming HTML.
21
+
22
+ The module itself attempts to handle generalized sanitization, while cutting some corners to forcibly marshal 'whatever' text into something tangible and compatible with Jira/Confluence.
23
+
24
+ This module is focused at **front-loading** incoming comments and descriptions for Jira and follows out of the box a relatively strict subset of tags from HTML.
25
+
26
+
27
+ ## Dependencies
28
+ Everything here is mostly a painfully hand-rolled parser; we have one dependency which is: `beautifulsoup4` non-version specific.
29
+
30
+ ### Supported and Converted tags
31
+ ```html
32
+ <html>
33
+ <body>
34
+
35
+ <h1>...<h6>
36
+ <head> -> Converted to a heading type
37
+ <title> -> Converted to a heading type
38
+
39
+ <div> -> Converted to a paragraph type
40
+ <p>
41
+
42
+ <table> -> Represents a tablebase
43
+ <thead> -> Represents a tablehead
44
+ <tbody> -> Represents a tablebody
45
+
46
+ <tr> -> represents a tablerow
47
+ <th> -> represents a tablecell
48
+ <td> -> represents a tablecell
49
+
50
+ Modifiers:
51
+
52
+ <b>
53
+ <strong>
54
+ <i>
55
+ <em>
56
+ <s>
57
+ <u>
58
+ ```
59
+
60
+ We also _support links and `<a>` tags_. (The magic under the hood can break; usually defaulting to nothing happening at all or [your entire line being a link](https://example.com/))
61
+
62
+ ### Example:
63
+
64
+ We'll convert the following HTML to ADF:
65
+
66
+ ```python
67
+ # test.py
68
+ from html_to_adf import import_html_to_str, convert_html_to_adf, export_document
69
+
70
+ html_text = import_html_to_str("test.html")
71
+
72
+ # If you were going to send this in an API request format, you would want to structure the ADF around a 'body {}'
73
+ # adding True to: convert_html_to_adf(html_text, True) will wrap the entire contents of the dict in a body {} for your ease of use.
74
+ resulting_adf_document: dict = convert_html_to_adf(html_text)
75
+
76
+
77
+ print(resulting_adf_document)
78
+ export_document(resulting_adf_document)
79
+
80
+ ```
81
+
82
+ ```html
83
+ <!--test.html-->
84
+
85
+ <html>
86
+ <head>
87
+ <title>Monthly Sales Report</title>
88
+ </head>
89
+ <body>
90
+ <h1>Monthly Sales Report</h1>
91
+ <p>
92
+ The following table shows <b>sales performance</b> by region for
93
+ <i>September 2025</i>.
94
+ For more info, visit our
95
+ <a href="https://example.com/reports/september">report page</a>.
96
+ </p>
97
+
98
+ <table>
99
+ <thead>
100
+ <tr>
101
+ <th>Region</th>
102
+ <th>Sales ($)</th>
103
+ <th>Growth</th>
104
+ </tr>
105
+ </thead>
106
+ <tbody>
107
+ <tr>
108
+ <td>North America</td>
109
+ <td><b>125,000</b></td>
110
+ <td><span style="color:green">+5%</span></td>
111
+ </tr>
112
+ <tr>
113
+ <td>Europe</td>
114
+ <td>98,500</td>
115
+ <td><span style="color:red">-2%</span></td>
116
+ </tr>
117
+ <tr>
118
+ <td>Asia-Pacific</td>
119
+ <td>142,750</td>
120
+ <td><u>+8%</u></td>
121
+ </tr>
122
+ </tbody>
123
+ </table>
124
+
125
+ <p>
126
+ Summary: <strong>Asia-Pacific</strong> led the month with strong growth.
127
+ <br>
128
+ Keep up the great work!
129
+ </p>
130
+ </body>
131
+ </html>
132
+ ```
133
+
134
+ This yields the following ADF:
135
+ [Here's the rather large textblob](https://raw.githubusercontent.com/actes2/html-to-adf/refs/heads/main/tests/output.json)
136
+ _To view in live time, copy that blob and float on over to the Atlassian Live Document Preview: https://developer.atlassian.com/cloud/jira/platform/apis/document/viewer/_
137
+
138
+ ![results.png](https://raw.githubusercontent.com/actes2/html-to-adf/refs/heads/main/tests/results.png)
139
+
140
+
141
+ ## Further development and support
142
+
143
+ This module is a creation of necessity, not passion; there's a large chance I won't update it very much, but that said if I get inspired you never know!
144
+
145
+ Feel free to drop something in the Issues section as you see them and I may visit those issues!
@@ -0,0 +1,129 @@
1
+ # html-to-adf - Convert HTML to ADF (Atlassian Document Format)
2
+
3
+ ## What is this?
4
+ This is a rudimentary python helper module, dedicated to producing Jira/Confluence ready ADF out of incoming HTML.
5
+
6
+ The module itself attempts to handle generalized sanitization, while cutting some corners to forcibly marshal 'whatever' text into something tangible and compatible with Jira/Confluence.
7
+
8
+ This module is focused at **front-loading** incoming comments and descriptions for Jira and follows out of the box a relatively strict subset of tags from HTML.
9
+
10
+
11
+ ## Dependencies
12
+ Everything here is mostly a painfully hand-rolled parser; we have one dependency which is: `beautifulsoup4` non-version specific.
13
+
14
+ ### Supported and Converted tags
15
+ ```html
16
+ <html>
17
+ <body>
18
+
19
+ <h1>...<h6>
20
+ <head> -> Converted to a heading type
21
+ <title> -> Converted to a heading type
22
+
23
+ <div> -> Converted to a paragraph type
24
+ <p>
25
+
26
+ <table> -> Represents a tablebase
27
+ <thead> -> Represents a tablehead
28
+ <tbody> -> Represents a tablebody
29
+
30
+ <tr> -> represents a tablerow
31
+ <th> -> represents a tablecell
32
+ <td> -> represents a tablecell
33
+
34
+ Modifiers:
35
+
36
+ <b>
37
+ <strong>
38
+ <i>
39
+ <em>
40
+ <s>
41
+ <u>
42
+ ```
43
+
44
+ We also _support links and `<a>` tags_. (The magic under the hood can break; usually defaulting to nothing happening at all or [your entire line being a link](https://example.com/))
45
+
46
+ ### Example:
47
+
48
+ We'll convert the following HTML to ADF:
49
+
50
+ ```python
51
+ # test.py
52
+ from html_to_adf import import_html_to_str, convert_html_to_adf, export_document
53
+
54
+ html_text = import_html_to_str("test.html")
55
+
56
+ # If you were going to send this in an API request format, you would want to structure the ADF around a 'body {}'
57
+ # adding True to: convert_html_to_adf(html_text, True) will wrap the entire contents of the dict in a body {} for your ease of use.
58
+ resulting_adf_document: dict = convert_html_to_adf(html_text)
59
+
60
+
61
+ print(resulting_adf_document)
62
+ export_document(resulting_adf_document)
63
+
64
+ ```
65
+
66
+ ```html
67
+ <!--test.html-->
68
+
69
+ <html>
70
+ <head>
71
+ <title>Monthly Sales Report</title>
72
+ </head>
73
+ <body>
74
+ <h1>Monthly Sales Report</h1>
75
+ <p>
76
+ The following table shows <b>sales performance</b> by region for
77
+ <i>September 2025</i>.
78
+ For more info, visit our
79
+ <a href="https://example.com/reports/september">report page</a>.
80
+ </p>
81
+
82
+ <table>
83
+ <thead>
84
+ <tr>
85
+ <th>Region</th>
86
+ <th>Sales ($)</th>
87
+ <th>Growth</th>
88
+ </tr>
89
+ </thead>
90
+ <tbody>
91
+ <tr>
92
+ <td>North America</td>
93
+ <td><b>125,000</b></td>
94
+ <td><span style="color:green">+5%</span></td>
95
+ </tr>
96
+ <tr>
97
+ <td>Europe</td>
98
+ <td>98,500</td>
99
+ <td><span style="color:red">-2%</span></td>
100
+ </tr>
101
+ <tr>
102
+ <td>Asia-Pacific</td>
103
+ <td>142,750</td>
104
+ <td><u>+8%</u></td>
105
+ </tr>
106
+ </tbody>
107
+ </table>
108
+
109
+ <p>
110
+ Summary: <strong>Asia-Pacific</strong> led the month with strong growth.
111
+ <br>
112
+ Keep up the great work!
113
+ </p>
114
+ </body>
115
+ </html>
116
+ ```
117
+
118
+ This yields the following ADF:
119
+ [Here's the rather large textblob](https://raw.githubusercontent.com/actes2/html-to-adf/refs/heads/main/tests/output.json)
120
+ _To view in live time, copy that blob and float on over to the Atlassian Live Document Preview: https://developer.atlassian.com/cloud/jira/platform/apis/document/viewer/_
121
+
122
+ ![results.png](https://raw.githubusercontent.com/actes2/html-to-adf/refs/heads/main/tests/results.png)
123
+
124
+
125
+ ## Further development and support
126
+
127
+ This module is a creation of necessity, not passion; there's a large chance I won't update it very much, but that said if I get inspired you never know!
128
+
129
+ Feel free to drop something in the Issues section as you see them and I may visit those issues!
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: html-to-adf
3
+ Version: 0.1.0
4
+ Summary: Convert HTML to Atlassian Document Format (ADF) for Jira and Confluence.
5
+ Author-email: Avery Tomlin <actesbusiness@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/actes2/html-to-adf
8
+ Project-URL: Documentation, https://github.com/actes2/html-to-adf#readme
9
+ Project-URL: Issues, https://github.com/actes2/html-to-adf/issues
10
+ Keywords: atlassian,jira,adf,html,converter
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: beautifulsoup4
15
+ Dynamic: license-file
16
+
17
+ # html-to-adf - Convert HTML to ADF (Atlassian Document Format)
18
+
19
+ ## What is this?
20
+ This is a rudimentary python helper module, dedicated to producing Jira/Confluence ready ADF out of incoming HTML.
21
+
22
+ The module itself attempts to handle generalized sanitization, while cutting some corners to forcibly marshal 'whatever' text into something tangible and compatible with Jira/Confluence.
23
+
24
+ This module is focused at **front-loading** incoming comments and descriptions for Jira and follows out of the box a relatively strict subset of tags from HTML.
25
+
26
+
27
+ ## Dependencies
28
+ Everything here is mostly a painfully hand-rolled parser; we have one dependency which is: `beautifulsoup4` non-version specific.
29
+
30
+ ### Supported and Converted tags
31
+ ```html
32
+ <html>
33
+ <body>
34
+
35
+ <h1>...<h6>
36
+ <head> -> Converted to a heading type
37
+ <title> -> Converted to a heading type
38
+
39
+ <div> -> Converted to a paragraph type
40
+ <p>
41
+
42
+ <table> -> Represents a tablebase
43
+ <thead> -> Represents a tablehead
44
+ <tbody> -> Represents a tablebody
45
+
46
+ <tr> -> represents a tablerow
47
+ <th> -> represents a tablecell
48
+ <td> -> represents a tablecell
49
+
50
+ Modifiers:
51
+
52
+ <b>
53
+ <strong>
54
+ <i>
55
+ <em>
56
+ <s>
57
+ <u>
58
+ ```
59
+
60
+ We also _support links and `<a>` tags_. (The magic under the hood can break; usually defaulting to nothing happening at all or [your entire line being a link](https://example.com/))
61
+
62
+ ### Example:
63
+
64
+ We'll convert the following HTML to ADF:
65
+
66
+ ```python
67
+ # test.py
68
+ from html_to_adf import import_html_to_str, convert_html_to_adf, export_document
69
+
70
+ html_text = import_html_to_str("test.html")
71
+
72
+ # If you were going to send this in an API request format, you would want to structure the ADF around a 'body {}'
73
+ # adding True to: convert_html_to_adf(html_text, True) will wrap the entire contents of the dict in a body {} for your ease of use.
74
+ resulting_adf_document: dict = convert_html_to_adf(html_text)
75
+
76
+
77
+ print(resulting_adf_document)
78
+ export_document(resulting_adf_document)
79
+
80
+ ```
81
+
82
+ ```html
83
+ <!--test.html-->
84
+
85
+ <html>
86
+ <head>
87
+ <title>Monthly Sales Report</title>
88
+ </head>
89
+ <body>
90
+ <h1>Monthly Sales Report</h1>
91
+ <p>
92
+ The following table shows <b>sales performance</b> by region for
93
+ <i>September 2025</i>.
94
+ For more info, visit our
95
+ <a href="https://example.com/reports/september">report page</a>.
96
+ </p>
97
+
98
+ <table>
99
+ <thead>
100
+ <tr>
101
+ <th>Region</th>
102
+ <th>Sales ($)</th>
103
+ <th>Growth</th>
104
+ </tr>
105
+ </thead>
106
+ <tbody>
107
+ <tr>
108
+ <td>North America</td>
109
+ <td><b>125,000</b></td>
110
+ <td><span style="color:green">+5%</span></td>
111
+ </tr>
112
+ <tr>
113
+ <td>Europe</td>
114
+ <td>98,500</td>
115
+ <td><span style="color:red">-2%</span></td>
116
+ </tr>
117
+ <tr>
118
+ <td>Asia-Pacific</td>
119
+ <td>142,750</td>
120
+ <td><u>+8%</u></td>
121
+ </tr>
122
+ </tbody>
123
+ </table>
124
+
125
+ <p>
126
+ Summary: <strong>Asia-Pacific</strong> led the month with strong growth.
127
+ <br>
128
+ Keep up the great work!
129
+ </p>
130
+ </body>
131
+ </html>
132
+ ```
133
+
134
+ This yields the following ADF:
135
+ [Here's the rather large textblob](https://raw.githubusercontent.com/actes2/html-to-adf/refs/heads/main/tests/output.json)
136
+ _To view in live time, copy that blob and float on over to the Atlassian Live Document Preview: https://developer.atlassian.com/cloud/jira/platform/apis/document/viewer/_
137
+
138
+ ![results.png](https://raw.githubusercontent.com/actes2/html-to-adf/refs/heads/main/tests/results.png)
139
+
140
+
141
+ ## Further development and support
142
+
143
+ This module is a creation of necessity, not passion; there's a large chance I won't update it very much, but that said if I get inspired you never know!
144
+
145
+ Feel free to drop something in the Issues section as you see them and I may visit those issues!
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ html_to_adf.py
4
+ pyproject.toml
5
+ html_to_adf.egg-info/PKG-INFO
6
+ html_to_adf.egg-info/SOURCES.txt
7
+ html_to_adf.egg-info/dependency_links.txt
8
+ html_to_adf.egg-info/requires.txt
9
+ html_to_adf.egg-info/top_level.txt
10
+ tests/test.py
@@ -0,0 +1 @@
1
+ beautifulsoup4
@@ -0,0 +1 @@
1
+ html_to_adf