mformat-ext 0.2__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,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: mformat_ext
3
+ Version: 0.2
4
+ Summary: Uniform way to write simple text extended with DOCX and ODT files
5
+ Author: Tom Björkholm
6
+ Author-email: Tom Björkholm <klausuler_linnet0q@icloud.com>
7
+ License-Expression: MIT
8
+ Project-URL: Source code, https://bitbucket.org/tom-bjorkholm/mformat
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.12
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: mformat>=0.0.1
14
+ Requires-Dist: python-docx>=1.2.0
15
+ Requires-Dist: odfpy>=1.4.1
16
+ Requires-Dist: msl-odt>=1.0
17
+ Requires-Dist: pip>=25.3
18
+ Requires-Dist: setuptools>=80.9.0
19
+ Requires-Dist: build>=1.3.0
20
+ Requires-Dist: wheel>=0.45.1
21
+ Dynamic: author
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+
25
+ # mformat
26
+
27
+ The mformat package contains a number of classes providing a uniform way for a python program to write to a number of different file formats.
28
+
29
+ The primary intended use is for text output from a python program, where the programmer would like the user to be able to select the output file formats. Some users may want the text as a Microsoft Word file, others as a LibreOffice Open Document Text file, while still others might want it as Markdown. By using the uniform way of writing provided by mformat the same python code can produce output in a number of different formats.
30
+
31
+ This is intended to provide an easy and uniform way to produce information in different formats. The emphasis is on getting the same information into the different formats. This will allow you to get a correct (but perhaps rudimentary) document in several formats. If you want to produce the most estetically pleasing document in a particular format, this is not the correct library to use.
32
+
33
+ ## Installing mformat (base package)
34
+
35
+ The base package contains support for the output formats that are supported with a minimum of dependencies. Use this if you for some reason want to avoid extra dependencies.
36
+
37
+ If you want to use it, install it using pip from [https://pypi.org/project/mformat](https://pypi.org/project/mformat). There is no need to download anything from Bitbucket to write Python programs that use the library.
38
+
39
+ ### Installing base mformat on mac and Linux
40
+
41
+ ````sh
42
+ pip3 install --upgrade mformat
43
+ ````
44
+
45
+ ### Installing base mformat on Microsoft Windows
46
+
47
+ ````sh
48
+ pip install --upgrade mformat
49
+ ````
50
+
51
+ ## Installing mformat-ext (extended package, this package)
52
+
53
+ The extended package contains support also for output formats that require some additional dependencies. Use this if you want the full selection of output formats.
54
+
55
+ If you want to use it, install it using pip from [https://pypi.org/project/mformat-ext](https://pypi.org/project/mformat-ext). There is no need to download anything from Bitbucket to write Python programs that use the library.
56
+
57
+ ### Installing extended mformat on mac and Linux
58
+
59
+ ````sh
60
+ pip3 install --upgrade mformat-ext
61
+ ````
62
+
63
+ ### Installing extended mformat on Microsoft Windows
64
+
65
+ ````sh
66
+ pip install --upgrade mformat-ext
67
+ ````
68
+
69
+ ## What it does
70
+
71
+ The main features supported in a uniform way for all supported output file formats are:
72
+
73
+ * Factory function that takes file format and output file name as arguments
74
+ * It opens and closes a file in the selected format, with protection against accidentically overwriting an existing file
75
+ * The recommended way to use it is as a context manager in a with-clause, opening and closing the file
76
+ * Headings (several levels)
77
+ * Paragraphs
78
+ * Nested bullet point lists
79
+ * Nested numbered point lists
80
+ * Mixed nested numbered point and bullet point lists
81
+ * Tables
82
+ * URLs in paragraphs, headings, numbered point list items and in bullet point list items
83
+
84
+ ## Design of program that uses mformat
85
+
86
+ It is recommended that the ouput function(s) of the a Python program using mformat should have a with-clause getting the formatting object from the factory (easiest with `with create_mf(file_format=fmt, file_name=output_file_name) as`).
87
+ In the context of the with-clause the programmer just calls a minimum of member functions:
88
+
89
+ * `start_paragraph` to start a new paragraph with some provided text content.
90
+ * `start_heading`to start a new heading with some provided text content.
91
+ * `start_bullet_item` to start a new bullet point list item with some provided text content, and if needed to start the bullet point list with the bullet point item.
92
+ * `start_numbered_point_item` to start a new numbered point list item with some provided text content, and if needed to start the numbered point list with the number point list item.
93
+ * `add_text` to add more text to an already started paragraph, heading, bullet point list item or numbered point list item.
94
+ * `add_url` to add a URL (link) to an already started paragraph, heading, bullet point list item or numbered point list item.
95
+ * `start_table` to start a new table with the provided first row.
96
+ * `add_table_row` to add another row to an already started table.
97
+ * `write_complete_table` to write a table all at once.
98
+ * `write_code_block` to write some preformatted text as a code block
99
+
100
+ There are no member functions to end or close any document item. Each document item is automatically closed as another docuemnt item is started (or when closing the file at the end of the context manager scope). `start_bullet_item`and `start_numbered_point_item` take an optional level argument, that is used to change to another nesting level.
101
+
102
+ ## Example programs
103
+
104
+ A number of minimal but complete example programs are provided to help the programmer new to mformat. See [list of examples](https://bitbucket.org/tom-bjorkholm/mformat/src/master/example/README.md).
105
+
106
+ ## API documentation
107
+
108
+ API documentation automatically extracted from the Python code and docstrings are available [here for the public API](https://bitbucket.org/tom-bjorkholm/mformat/src/master/doc/api.md) for programmers using the API and [here for the protected API](https://bitbucket.org/tom-bjorkholm/mformat/src/master/doc/protected_api.md) for programmers that want to extend the API by adding their own derived class that provide some other output format.
109
+
110
+ Even though some may like reading API documentation, the [example programs](https://bitbucket.org/tom-bjorkholm/mformat/src/master/example/README.md) probably provide a better introduction.
111
+
112
+ ## Version history
113
+
114
+ | Version | Date | Python version | Description |
115
+ |---------|-------------|-----------------|-------------------------------------|
116
+ | 0.2 | 30 Jan 2026 | 3.12 or newer | First released version |
117
+
118
+ ## Output file formats
119
+
120
+ The following table provides information about in which version support for a format was introduced.
121
+
122
+ | Format | Full name of format | Which package | Starting at version |
123
+ |--------|---------------------|---------------|---------------------|
124
+ | docx | Microsoft Word | mformat-ext | 0.2 |
125
+ | html | Web page | mformat | 0.2 |
126
+ | md | Markdown | mformat | 0.2 |
127
+ | odt | Open Document Text | mformat-ext | 0.2 |
128
+
129
+ ## Test summary
130
+
131
+ * Test result: 916 passed in 10s
132
+ * No Flake8 warnings.
133
+ * No mypy errors found.
134
+ * 0.2 built and tested using python version: Python 3.14.2
@@ -0,0 +1,110 @@
1
+ # mformat
2
+
3
+ The mformat package contains a number of classes providing a uniform way for a python program to write to a number of different file formats.
4
+
5
+ The primary intended use is for text output from a python program, where the programmer would like the user to be able to select the output file formats. Some users may want the text as a Microsoft Word file, others as a LibreOffice Open Document Text file, while still others might want it as Markdown. By using the uniform way of writing provided by mformat the same python code can produce output in a number of different formats.
6
+
7
+ This is intended to provide an easy and uniform way to produce information in different formats. The emphasis is on getting the same information into the different formats. This will allow you to get a correct (but perhaps rudimentary) document in several formats. If you want to produce the most estetically pleasing document in a particular format, this is not the correct library to use.
8
+
9
+ ## Installing mformat (base package)
10
+
11
+ The base package contains support for the output formats that are supported with a minimum of dependencies. Use this if you for some reason want to avoid extra dependencies.
12
+
13
+ If you want to use it, install it using pip from [https://pypi.org/project/mformat](https://pypi.org/project/mformat). There is no need to download anything from Bitbucket to write Python programs that use the library.
14
+
15
+ ### Installing base mformat on mac and Linux
16
+
17
+ ````sh
18
+ pip3 install --upgrade mformat
19
+ ````
20
+
21
+ ### Installing base mformat on Microsoft Windows
22
+
23
+ ````sh
24
+ pip install --upgrade mformat
25
+ ````
26
+
27
+ ## Installing mformat-ext (extended package, this package)
28
+
29
+ The extended package contains support also for output formats that require some additional dependencies. Use this if you want the full selection of output formats.
30
+
31
+ If you want to use it, install it using pip from [https://pypi.org/project/mformat-ext](https://pypi.org/project/mformat-ext). There is no need to download anything from Bitbucket to write Python programs that use the library.
32
+
33
+ ### Installing extended mformat on mac and Linux
34
+
35
+ ````sh
36
+ pip3 install --upgrade mformat-ext
37
+ ````
38
+
39
+ ### Installing extended mformat on Microsoft Windows
40
+
41
+ ````sh
42
+ pip install --upgrade mformat-ext
43
+ ````
44
+
45
+ ## What it does
46
+
47
+ The main features supported in a uniform way for all supported output file formats are:
48
+
49
+ * Factory function that takes file format and output file name as arguments
50
+ * It opens and closes a file in the selected format, with protection against accidentically overwriting an existing file
51
+ * The recommended way to use it is as a context manager in a with-clause, opening and closing the file
52
+ * Headings (several levels)
53
+ * Paragraphs
54
+ * Nested bullet point lists
55
+ * Nested numbered point lists
56
+ * Mixed nested numbered point and bullet point lists
57
+ * Tables
58
+ * URLs in paragraphs, headings, numbered point list items and in bullet point list items
59
+
60
+ ## Design of program that uses mformat
61
+
62
+ It is recommended that the ouput function(s) of the a Python program using mformat should have a with-clause getting the formatting object from the factory (easiest with `with create_mf(file_format=fmt, file_name=output_file_name) as`).
63
+ In the context of the with-clause the programmer just calls a minimum of member functions:
64
+
65
+ * `start_paragraph` to start a new paragraph with some provided text content.
66
+ * `start_heading`to start a new heading with some provided text content.
67
+ * `start_bullet_item` to start a new bullet point list item with some provided text content, and if needed to start the bullet point list with the bullet point item.
68
+ * `start_numbered_point_item` to start a new numbered point list item with some provided text content, and if needed to start the numbered point list with the number point list item.
69
+ * `add_text` to add more text to an already started paragraph, heading, bullet point list item or numbered point list item.
70
+ * `add_url` to add a URL (link) to an already started paragraph, heading, bullet point list item or numbered point list item.
71
+ * `start_table` to start a new table with the provided first row.
72
+ * `add_table_row` to add another row to an already started table.
73
+ * `write_complete_table` to write a table all at once.
74
+ * `write_code_block` to write some preformatted text as a code block
75
+
76
+ There are no member functions to end or close any document item. Each document item is automatically closed as another docuemnt item is started (or when closing the file at the end of the context manager scope). `start_bullet_item`and `start_numbered_point_item` take an optional level argument, that is used to change to another nesting level.
77
+
78
+ ## Example programs
79
+
80
+ A number of minimal but complete example programs are provided to help the programmer new to mformat. See [list of examples](https://bitbucket.org/tom-bjorkholm/mformat/src/master/example/README.md).
81
+
82
+ ## API documentation
83
+
84
+ API documentation automatically extracted from the Python code and docstrings are available [here for the public API](https://bitbucket.org/tom-bjorkholm/mformat/src/master/doc/api.md) for programmers using the API and [here for the protected API](https://bitbucket.org/tom-bjorkholm/mformat/src/master/doc/protected_api.md) for programmers that want to extend the API by adding their own derived class that provide some other output format.
85
+
86
+ Even though some may like reading API documentation, the [example programs](https://bitbucket.org/tom-bjorkholm/mformat/src/master/example/README.md) probably provide a better introduction.
87
+
88
+ ## Version history
89
+
90
+ | Version | Date | Python version | Description |
91
+ |---------|-------------|-----------------|-------------------------------------|
92
+ | 0.2 | 30 Jan 2026 | 3.12 or newer | First released version |
93
+
94
+ ## Output file formats
95
+
96
+ The following table provides information about in which version support for a format was introduced.
97
+
98
+ | Format | Full name of format | Which package | Starting at version |
99
+ |--------|---------------------|---------------|---------------------|
100
+ | docx | Microsoft Word | mformat-ext | 0.2 |
101
+ | html | Web page | mformat | 0.2 |
102
+ | md | Markdown | mformat | 0.2 |
103
+ | odt | Open Document Text | mformat-ext | 0.2 |
104
+
105
+ ## Test summary
106
+
107
+ * Test result: 916 passed in 10s
108
+ * No Flake8 warnings.
109
+ * No mypy errors found.
110
+ * 0.2 built and tested using python version: Python 3.14.2
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: mformat_ext
3
+ Version: 0.2
4
+ Summary: Uniform way to write simple text extended with DOCX and ODT files
5
+ Author: Tom Björkholm
6
+ Author-email: Tom Björkholm <klausuler_linnet0q@icloud.com>
7
+ License-Expression: MIT
8
+ Project-URL: Source code, https://bitbucket.org/tom-bjorkholm/mformat
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.12
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: mformat>=0.0.1
14
+ Requires-Dist: python-docx>=1.2.0
15
+ Requires-Dist: odfpy>=1.4.1
16
+ Requires-Dist: msl-odt>=1.0
17
+ Requires-Dist: pip>=25.3
18
+ Requires-Dist: setuptools>=80.9.0
19
+ Requires-Dist: build>=1.3.0
20
+ Requires-Dist: wheel>=0.45.1
21
+ Dynamic: author
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+
25
+ # mformat
26
+
27
+ The mformat package contains a number of classes providing a uniform way for a python program to write to a number of different file formats.
28
+
29
+ The primary intended use is for text output from a python program, where the programmer would like the user to be able to select the output file formats. Some users may want the text as a Microsoft Word file, others as a LibreOffice Open Document Text file, while still others might want it as Markdown. By using the uniform way of writing provided by mformat the same python code can produce output in a number of different formats.
30
+
31
+ This is intended to provide an easy and uniform way to produce information in different formats. The emphasis is on getting the same information into the different formats. This will allow you to get a correct (but perhaps rudimentary) document in several formats. If you want to produce the most estetically pleasing document in a particular format, this is not the correct library to use.
32
+
33
+ ## Installing mformat (base package)
34
+
35
+ The base package contains support for the output formats that are supported with a minimum of dependencies. Use this if you for some reason want to avoid extra dependencies.
36
+
37
+ If you want to use it, install it using pip from [https://pypi.org/project/mformat](https://pypi.org/project/mformat). There is no need to download anything from Bitbucket to write Python programs that use the library.
38
+
39
+ ### Installing base mformat on mac and Linux
40
+
41
+ ````sh
42
+ pip3 install --upgrade mformat
43
+ ````
44
+
45
+ ### Installing base mformat on Microsoft Windows
46
+
47
+ ````sh
48
+ pip install --upgrade mformat
49
+ ````
50
+
51
+ ## Installing mformat-ext (extended package, this package)
52
+
53
+ The extended package contains support also for output formats that require some additional dependencies. Use this if you want the full selection of output formats.
54
+
55
+ If you want to use it, install it using pip from [https://pypi.org/project/mformat-ext](https://pypi.org/project/mformat-ext). There is no need to download anything from Bitbucket to write Python programs that use the library.
56
+
57
+ ### Installing extended mformat on mac and Linux
58
+
59
+ ````sh
60
+ pip3 install --upgrade mformat-ext
61
+ ````
62
+
63
+ ### Installing extended mformat on Microsoft Windows
64
+
65
+ ````sh
66
+ pip install --upgrade mformat-ext
67
+ ````
68
+
69
+ ## What it does
70
+
71
+ The main features supported in a uniform way for all supported output file formats are:
72
+
73
+ * Factory function that takes file format and output file name as arguments
74
+ * It opens and closes a file in the selected format, with protection against accidentically overwriting an existing file
75
+ * The recommended way to use it is as a context manager in a with-clause, opening and closing the file
76
+ * Headings (several levels)
77
+ * Paragraphs
78
+ * Nested bullet point lists
79
+ * Nested numbered point lists
80
+ * Mixed nested numbered point and bullet point lists
81
+ * Tables
82
+ * URLs in paragraphs, headings, numbered point list items and in bullet point list items
83
+
84
+ ## Design of program that uses mformat
85
+
86
+ It is recommended that the ouput function(s) of the a Python program using mformat should have a with-clause getting the formatting object from the factory (easiest with `with create_mf(file_format=fmt, file_name=output_file_name) as`).
87
+ In the context of the with-clause the programmer just calls a minimum of member functions:
88
+
89
+ * `start_paragraph` to start a new paragraph with some provided text content.
90
+ * `start_heading`to start a new heading with some provided text content.
91
+ * `start_bullet_item` to start a new bullet point list item with some provided text content, and if needed to start the bullet point list with the bullet point item.
92
+ * `start_numbered_point_item` to start a new numbered point list item with some provided text content, and if needed to start the numbered point list with the number point list item.
93
+ * `add_text` to add more text to an already started paragraph, heading, bullet point list item or numbered point list item.
94
+ * `add_url` to add a URL (link) to an already started paragraph, heading, bullet point list item or numbered point list item.
95
+ * `start_table` to start a new table with the provided first row.
96
+ * `add_table_row` to add another row to an already started table.
97
+ * `write_complete_table` to write a table all at once.
98
+ * `write_code_block` to write some preformatted text as a code block
99
+
100
+ There are no member functions to end or close any document item. Each document item is automatically closed as another docuemnt item is started (or when closing the file at the end of the context manager scope). `start_bullet_item`and `start_numbered_point_item` take an optional level argument, that is used to change to another nesting level.
101
+
102
+ ## Example programs
103
+
104
+ A number of minimal but complete example programs are provided to help the programmer new to mformat. See [list of examples](https://bitbucket.org/tom-bjorkholm/mformat/src/master/example/README.md).
105
+
106
+ ## API documentation
107
+
108
+ API documentation automatically extracted from the Python code and docstrings are available [here for the public API](https://bitbucket.org/tom-bjorkholm/mformat/src/master/doc/api.md) for programmers using the API and [here for the protected API](https://bitbucket.org/tom-bjorkholm/mformat/src/master/doc/protected_api.md) for programmers that want to extend the API by adding their own derived class that provide some other output format.
109
+
110
+ Even though some may like reading API documentation, the [example programs](https://bitbucket.org/tom-bjorkholm/mformat/src/master/example/README.md) probably provide a better introduction.
111
+
112
+ ## Version history
113
+
114
+ | Version | Date | Python version | Description |
115
+ |---------|-------------|-----------------|-------------------------------------|
116
+ | 0.2 | 30 Jan 2026 | 3.12 or newer | First released version |
117
+
118
+ ## Output file formats
119
+
120
+ The following table provides information about in which version support for a format was introduced.
121
+
122
+ | Format | Full name of format | Which package | Starting at version |
123
+ |--------|---------------------|---------------|---------------------|
124
+ | docx | Microsoft Word | mformat-ext | 0.2 |
125
+ | html | Web page | mformat | 0.2 |
126
+ | md | Markdown | mformat | 0.2 |
127
+ | odt | Open Document Text | mformat-ext | 0.2 |
128
+
129
+ ## Test summary
130
+
131
+ * Test result: 916 passed in 10s
132
+ * No Flake8 warnings.
133
+ * No mypy errors found.
134
+ * 0.2 built and tested using python version: Python 3.14.2
@@ -0,0 +1,13 @@
1
+ README_pypi.md
2
+ pyproject.toml
3
+ setup.py
4
+ mformat_ext.egg-info/PKG-INFO
5
+ mformat_ext.egg-info/SOURCES.txt
6
+ mformat_ext.egg-info/dependency_links.txt
7
+ mformat_ext.egg-info/requires.txt
8
+ mformat_ext.egg-info/top_level.txt
9
+ src/mformat_ext/__init__.py
10
+ src/mformat_ext/mformat_docx.py
11
+ src/mformat_ext/mformat_odt.py
12
+ src/mformat_ext/py.typed
13
+ src/mformat_ext/reg_extpkg_formats.py
@@ -0,0 +1,8 @@
1
+ mformat>=0.0.1
2
+ python-docx>=1.2.0
3
+ odfpy>=1.4.1
4
+ msl-odt>=1.0
5
+ pip>=25.3
6
+ setuptools>=80.9.0
7
+ build>=1.3.0
8
+ wheel>=0.45.1
@@ -0,0 +1 @@
1
+ mformat_ext
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "mformat_ext"
7
+ version = "0.2"
8
+ authors = [
9
+ { name="Tom Björkholm", email="klausuler_linnet0q@icloud.com" },
10
+ ]
11
+ description = "Uniform way to write simple text extended with DOCX and ODT files"
12
+ readme = "README_pypi.md"
13
+ requires-python = ">=3.12"
14
+ license = "MIT"
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Operating System :: OS Independent",
18
+ ]
19
+ dynamic = ["dependencies"]
20
+
21
+ [project.urls]
22
+ "Source code" = "https://bitbucket.org/tom-bjorkholm/mformat"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,26 @@
1
+ #! /usr/local/bin/python3
2
+ """Setup file specifying build of .whl."""
3
+
4
+ from setuptools import setup
5
+
6
+ setup(
7
+ name='mformat_ext',
8
+ version='0.2',
9
+ description='Uniform way to write simple text extended with DOCX and ODT files',
10
+ author='Tom Björkholm',
11
+ author_email='klausuler_linnet0q@icloud.com',
12
+ python_requires='>=3.12',
13
+ packages=['mformat_ext'],
14
+ package_dir={'mformat_ext': 'src/mformat_ext'},
15
+ package_data={'mformat_ext': ['src/py.typed']},
16
+ install_requires=[ # pylint: disable=duplicate-code
17
+ 'mformat >= 0.0.1',
18
+ 'python-docx >= 1.2.0',
19
+ 'odfpy >= 1.4.1',
20
+ 'msl-odt >= 1.0',
21
+ 'pip >= 25.3',
22
+ 'setuptools >= 80.9.0',
23
+ 'build >= 1.3.0',
24
+ 'wheel>=0.45.1'
25
+ ]
26
+ )
@@ -0,0 +1,6 @@
1
+ #! /usr/local/bin/python3
2
+ """Initialize the mformat_ext package."""
3
+
4
+ # Copyright (c) 2025 - 2026 Tom Björkholm
5
+ # MIT License
6
+ #