Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
Release History
---------------

2.1.0 (2025-03-01)
++++++++++++++++++

- Fix items not being fully moved to new namespace

2.0.0 (2025-02-16)
++++++++++++++++++

- Move to private `skelmis` namespace to reduce collision issues. `PR here <https://github.com/Skelmis/python-docx/pull/15>`

1.2.X -> 1.6.X
++++++++++++++

- Supporting multiple numbered lists within a document (`1 <https://skelmis-docx.readthedocs.io/en/latest/api/text.html#docx.text.paragraph.Paragraph.restart_numbering>`, `2 <https://skelmis-docx.readthedocs.io/en/latest/api/document.html#docx.document.Document.configure_styles_for_numbered_lists>`)
- Supporting TOC updates within the package without the need to open the document manually (`1 <https://skelmis-docx.readthedocs.io/en/latest/api/utility.html#docx.utility.update_toc>`, `2 <https://skelmis-docx.readthedocs.io/en/latest/api/utility.html#docx.utility.export_libre_macro>`)
- Supporting floating images within documents (`1 <https://skelmis-docx.readthedocs.io/en/latest/api/text.html#docx.text.run.Run.add_float_picture>`)
- Supporting the ability to transform word documents into PDF's (`1 <https://skelmis-docx.readthedocs.io/en/latest/api/utility.html#docx.utility.document_to_pdf>`)
- Horizontal rules + paragraph bounding boxes / borders (`1 <https://skelmis-docx.readthedocs.io/en/latest/api/text.html#docx.text.paragraph.Paragraph.insert_horizontal_rule>`, `2 <https://skelmis-docx.readthedocs.io/en/latest/api/text.html#docx.text.paragraph.Paragraph.draw_paragraph_border>`)
- External hyperlinks (`1 <https://skelmis-docx.readthedocs.io/en/latest/api/text.html#docx.text.paragraph.Paragraph.add_external_hyperlink>`)

1.1.2 (2024-05-01)
++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion docs/api/dml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ contexts.
|ColorFormat| objects
---------------------

.. autoclass:: docx.dml.color.ColorFormat()
.. autoclass:: skelmis.docx.dml.color.ColorFormat()
:members:
:undoc-members:
6 changes: 3 additions & 3 deletions docs/api/document.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ The main Document and related objects.
|Document| constructor
----------------------

.. autofunction:: docx.Document
.. autofunction:: skelmis.docx.Document


|Document| objects
------------------

.. autoclass:: docx.document.Document()
.. autoclass:: skelmis.docx.document.Document()
:members:
:exclude-members: styles_part

Expand Down Expand Up @@ -44,7 +44,7 @@ values for the title, last_modified_by, revision, and modified properties.
Client code should update properties like revision and last_modified_by
if that behavior is desired.

.. currentmodule:: docx.opc.coreprops
.. currentmodule:: skelmis.docx.opc.coreprops

.. class:: CoreProperties

Expand Down
2 changes: 1 addition & 1 deletion docs/api/section.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Provides access to section properties such as margins and page orientation.
|Sections| objects
------------------

.. currentmodule:: docx.section
.. currentmodule:: skelmis.docx.section

.. autoclass:: Sections
:members:
Expand Down
2 changes: 1 addition & 1 deletion docs/api/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Document |Settings| objects
---------------------------

.. currentmodule:: docx.settings
.. currentmodule:: skelmis.docx.settings

.. autoclass:: Settings()
:members:
Expand Down
2 changes: 1 addition & 1 deletion docs/api/shape.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Shape-related objects
=====================

.. currentmodule:: docx.shape
.. currentmodule:: skelmis.docx.shape


|InlineShapes| objects
Expand Down
2 changes: 1 addition & 1 deletion docs/api/shared.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Shared classes
==============

.. currentmodule:: docx.shared
.. currentmodule:: skelmis.docx.shared


Length objects
Expand Down
6 changes: 3 additions & 3 deletions docs/api/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ in the appropriate style.
|Styles| objects
----------------

.. currentmodule:: docx.styles.styles
.. currentmodule:: skelmis.docx.styles.styles

.. autoclass:: Styles()
:members:
Expand All @@ -26,7 +26,7 @@ in the appropriate style.
|BaseStyle| objects
-------------------

.. currentmodule:: docx.styles.style
.. currentmodule:: skelmis.docx.styles.style

.. autoclass:: BaseStyle()
:members:
Expand Down Expand Up @@ -78,7 +78,7 @@ in the appropriate style.
|LatentStyles| objects
----------------------

.. currentmodule:: docx.styles.latent
.. currentmodule:: skelmis.docx.styles.latent

.. autoclass:: LatentStyles()
:members:
Expand Down
2 changes: 1 addition & 1 deletion docs/api/table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Table objects
Table objects are constructed using the ``add_table()`` method on |Document|.


.. currentmodule:: docx.table
.. currentmodule:: skelmis.docx.table


|Table| objects
Expand Down
18 changes: 9 additions & 9 deletions docs/api/text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,56 @@ Text-related objects
|Paragraph| objects
-------------------

.. autoclass:: docx.text.paragraph.Paragraph()
.. autoclass:: skelmis.docx.text.paragraph.Paragraph()
:members:


|ParagraphFormat| objects
-------------------------

.. autoclass:: docx.text.parfmt.ParagraphFormat()
.. autoclass:: skelmis.docx.text.parfmt.ParagraphFormat()
:members:


|Hyperlink| objects
-------------------

.. autoclass:: docx.text.hyperlink.Hyperlink()
.. autoclass:: skelmis.docx.text.hyperlink.Hyperlink()
:members:


|Run| objects
-------------

.. autoclass:: docx.text.run.Run()
.. autoclass:: skelmis.docx.text.run.Run()
:members:


|Font| objects
--------------

.. autoclass:: docx.text.run.Font()
.. autoclass:: skelmis.docx.text.run.Font()
:members:


|RenderedPageBreak| objects
---------------------------

.. autoclass:: docx.text.pagebreak.RenderedPageBreak()
.. autoclass:: skelmis.docx.text.pagebreak.RenderedPageBreak()
:members:


|TabStop| objects
-----------------

.. autoclass:: docx.text.tabstops.TabStop()
.. autoclass:: skelmis.docx.text.tabstops.TabStop()
:members:


|TabStops| objects
------------------

.. autoclass:: docx.text.tabstops.TabStops()
.. autoclass:: skelmis.docx.text.tabstops.TabStops()
:members: clear_all

.. automethod:: docx.text.tabstops.TabStops.add_tab_stop(position, alignment=WD_TAB_ALIGNMENT.LEFT, leader=WD_TAB_LEADER.SPACES)
.. automethod:: skelmis.docx.text.tabstops.TabStops.add_tab_stop(position, alignment=WD_TAB_ALIGNMENT.LEFT, leader=WD_TAB_LEADER.SPACES)
6 changes: 3 additions & 3 deletions docs/api/utility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Utility objects
Docx2pdf
--------

.. autofunction:: docx.utility.document_to_pdf
.. autofunction:: skelmis.docx.utility.document_to_pdf

.. autofunction:: docx.utility.export_libre_macro
.. autofunction:: skelmis.docx.utility.export_libre_macro

.. autofunction:: docx.utility.update_toc
.. autofunction:: skelmis.docx.utility.update_toc
4 changes: 2 additions & 2 deletions docs/user/sections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ possibility using a ``len()`` check or ``try`` block to avoid an uncaught
Adding a new section
--------------------

.. currentmodule:: docx.api
.. currentmodule:: skelmis.docx.api

The :meth:`Document.add_section` method allows a new section to be started at
the end of the document. Paragraphs and tables added after calling this method
Expand All @@ -62,7 +62,7 @@ will appear in the new section::
Section properties
------------------

.. currentmodule:: docx.section
.. currentmodule:: skelmis.docx.section

The |Section| object has eleven properties that allow page layout settings to
be discovered and specified.
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[tool.poetry]
name = "skelmis-docx"
version = "2.0.0"
version = "2.1.0"
description = "Create, read, and update Microsoft Word .docx files."
authors = ["Skelmis <skelmis.craft@gmail.com>"]
license = "MIT"
readme = "README.md"
packages = [{include = "skelmis/docx", from="src"}]

[project.urls]
Homepage = "https://github.com/skelmis/python-docx"
Documentation = "https://skelmis-docx.readthedocs.io/en/latest/"
#[project.urls]
#Homepage = "https://github.com/skelmis/python-docx"
#Documentation = "https://skelmis-docx.readthedocs.io/en/latest/"

[tool.poetry.dependencies]
python = "^3.10"
Expand All @@ -29,7 +29,7 @@ pyparsing = "^3.1.2"
pytest = "^8.3.2"
pytest-coverage = "^0.0"
pytest-xdist = "^3.6.1"
black = "^24.8.0"
black = "^24.10.0"

[tool.poetry.group.docs.dependencies]
sphinx = "^8.0.2"
Expand Down
2 changes: 1 addition & 1 deletion src/skelmis/docx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
if TYPE_CHECKING:
from skelmis.docx.opc.part import Part

__version__ = "1.6.2"
__version__ = "2.1.0"


__all__ = ["Document"]
Expand Down
2 changes: 1 addition & 1 deletion src/skelmis/docx/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def configure_styles_for_numbered_lists(self):
then you should override this method with your own styling choices
as these are shipped 'as is' and are generally good enough.
"""
STYP = docx.enum.style.WD_STYLE_TYPE
STYP = skelmis.docx.enum.style.WD_STYLE_TYPE
num_xml = self.part.numbering_part.element
next_abstract_id = max([J.abstractNumId for J in num_xml.abstractNum_lst]) + 1
l = num_xml._new_abstractNum()
Expand Down
2 changes: 1 addition & 1 deletion src/skelmis/docx/oxml/shared.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Objects shared by modules in the docx.oxml subpackage."""
"""Objects shared by modules in the skelmis.docx.oxml subpackage."""

from __future__ import annotations

Expand Down
6 changes: 5 additions & 1 deletion src/skelmis/docx/oxml/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

from typing import TYPE_CHECKING, Callable, cast

from skelmis.docx.enum.table import WD_CELL_VERTICAL_ALIGNMENT, WD_ROW_HEIGHT_RULE, WD_TABLE_DIRECTION
from skelmis.docx.enum.table import (
WD_CELL_VERTICAL_ALIGNMENT,
WD_ROW_HEIGHT_RULE,
WD_TABLE_DIRECTION,
)
from skelmis.docx.exceptions import InvalidSpanError
from skelmis.docx.oxml.ns import nsdecls, qn
from skelmis.docx.oxml.parser import parse_xml
Expand Down
2 changes: 1 addition & 1 deletion src/skelmis/docx/styles/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Sub-package module for docx.styles sub-package."""
"""Sub-package module for skelmis.docx.styles sub-package."""

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion tests/dml/test_color.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Test suite for docx.dml.color module."""
"""Test suite for skelmis.docx.dml.color module."""

import pytest

Expand Down
2 changes: 1 addition & 1 deletion tests/image/test_bmp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Test suite for docx.image.bmp module."""
"""Test suite for skelmis.docx.image.bmp module."""

import io

Expand Down
2 changes: 1 addition & 1 deletion tests/image/test_gif.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Unit test suite for docx.image.gif module."""
"""Unit test suite for skelmis.docx.image.gif module."""

import io

Expand Down
2 changes: 1 addition & 1 deletion tests/image/test_helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Test suite for docx.image.helpers module."""
"""Test suite for skelmis.docx.image.helpers module."""

import io

Expand Down
2 changes: 1 addition & 1 deletion tests/image/test_image.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Unit test suite for docx.image package"""
"""Unit test suite for skelmis.docx.image package"""

import io

Expand Down
10 changes: 7 additions & 3 deletions tests/image/test_jpeg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Unit test suite for docx.image.jpeg module"""
"""Unit test suite for skelmis.docx.image.jpeg module"""

import io

Expand Down Expand Up @@ -346,7 +346,9 @@ def _App1Marker__init_(self, request):
def get_tiff_fixture(self, request, substream_, Tiff_, tiff_):
bytes_ = b"xfillerxMM\x00*\x00\x00\x00\x42"
stream_reader = StreamReader(io.BytesIO(bytes_), BIG_ENDIAN)
BytesIO_ = class_mock(request, "skelmis.docx.image.jpeg.io.BytesIO", return_value=substream_)
BytesIO_ = class_mock(
request, "skelmis.docx.image.jpeg.io.BytesIO", return_value=substream_
)
offset, segment_length, segment_bytes = 0, 16, bytes_[8:]
return (
stream_reader,
Expand Down Expand Up @@ -622,7 +624,9 @@ def stream_(self, request):

@pytest.fixture
def StreamReader_(self, request, stream_reader_):
return class_mock(request, "skelmis.docx.image.jpeg.StreamReader", return_value=stream_reader_)
return class_mock(
request, "skelmis.docx.image.jpeg.StreamReader", return_value=stream_reader_
)

@pytest.fixture
def stream_reader_(self, request):
Expand Down
6 changes: 4 additions & 2 deletions tests/image/test_png.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Unit test suite for docx.image.png module."""
"""Unit test suite for skelmis.docx.image.png module."""

import io

Expand Down Expand Up @@ -271,7 +271,9 @@ def chunk_2_(self, request):

@pytest.fixture
def _ChunkFactory_(self, request, chunk_lst_):
return function_mock(request, "skelmis.docx.image.png._ChunkFactory", side_effect=chunk_lst_)
return function_mock(
request, "skelmis.docx.image.png._ChunkFactory", side_effect=chunk_lst_
)

@pytest.fixture
def chunk_lst_(self, chunk_, chunk_2_):
Expand Down
2 changes: 1 addition & 1 deletion tests/image/test_tiff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Unit test suite for docx.image.tiff module"""
"""Unit test suite for skelmis.docx.image.tiff module"""

import io

Expand Down
2 changes: 1 addition & 1 deletion tests/opc/parts/test_coreprops.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Unit test suite for the docx.opc.parts.coreprops module."""
"""Unit test suite for the skelmis.docx.opc.parts.coreprops module."""

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion tests/opc/test_coreprops.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pyright: reportPrivateUsage=false

"""Unit test suite for the docx.opc.coreprops module."""
"""Unit test suite for the skelmis.docx.opc.coreprops module."""

from __future__ import annotations

Expand Down
Loading