Skip to content

Commit 034da15

Browse files
committed
rename module from docx_edit to docx_editor
Rename the Python module directory and update all imports to match the PyPI package name for consistency. Users now import with: from docx_editor import Document
1 parent 415a755 commit 034da15

27 files changed

Lines changed: 50 additions & 50 deletions

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pip install docx-editor
3030
## Quick Start
3131

3232
```python
33-
from docx_edit import Document
33+
from docx_editor import Document
3434

3535
with Document.open("contract.docx") as doc:
3636
# Track changes

‎docs/api.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The main entry point for docx-editor. Provides methods for opening documents, making tracked changes, managing comments, and handling revisions.
66

77
```python
8-
from docx_edit import Document
8+
from docx_editor import Document
99
```
1010

1111
### Opening Documents
@@ -335,7 +335,7 @@ doc.close(cleanup=False) # Keep workspace for inspection
335335
Represents a document comment.
336336

337337
```python
338-
from docx_edit import Comment
338+
from docx_editor import Comment
339339
```
340340

341341
### Attributes
@@ -369,7 +369,7 @@ for comment in comments:
369369
Represents a tracked change (insertion or deletion).
370370

371371
```python
372-
from docx_edit import Revision
372+
from docx_editor import Revision
373373
```
374374

375375
### Attributes
@@ -400,7 +400,7 @@ for rev in revisions:
400400
Raised when the specified text is not found in the document.
401401

402402
```python
403-
from docx_edit.exceptions import TextNotFoundError
403+
from docx_editor.exceptions import TextNotFoundError
404404

405405
try:
406406
doc.replace("nonexistent text", "new text")
@@ -413,7 +413,7 @@ except TextNotFoundError as e:
413413
Raised when a comment operation fails.
414414

415415
```python
416-
from docx_edit.exceptions import CommentError
416+
from docx_editor.exceptions import CommentError
417417

418418
try:
419419
doc.reply_to_comment(999, "reply")
@@ -426,21 +426,21 @@ except CommentError as e:
426426
Raised when a revision operation fails.
427427

428428
```python
429-
from docx_edit.exceptions import RevisionError
429+
from docx_editor.exceptions import RevisionError
430430
```
431431

432432
### `WorkspaceExistsError`
433433

434434
Raised when attempting to create a workspace that already exists.
435435

436436
```python
437-
from docx_edit.exceptions import WorkspaceExistsError
437+
from docx_editor.exceptions import WorkspaceExistsError
438438
```
439439

440440
### `WorkspaceSyncError`
441441

442442
Raised when the workspace is out of sync with the source document.
443443

444444
```python
445-
from docx_edit.exceptions import WorkspaceSyncError
445+
from docx_editor.exceptions import WorkspaceSyncError
446446
```

‎docs/index.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pip install docx-editor
2121
## Quick Start
2222

2323
```python
24-
from docx_edit import Document
24+
from docx_editor import Document
2525

2626
# Open and edit
2727
doc = Document.open("contract.docx")
@@ -46,7 +46,7 @@ doc.close()
4646
## Context Manager
4747

4848
```python
49-
from docx_edit import Document
49+
from docx_editor import Document
5050

5151
with Document.open("contract.docx") as doc:
5252
doc.replace("old term", "new term")

‎docs/quickstart.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This guide covers the essential usage patterns for docx-editor.
77
### Basic Open
88

99
```python
10-
from docx_edit import Document
10+
from docx_editor import Document
1111

1212
doc = Document.open("contract.docx")
1313
# ... make changes ...
@@ -36,7 +36,7 @@ doc = Document.open("contract.docx", force_recreate=True)
3636
The recommended approach for automatic cleanup:
3737

3838
```python
39-
from docx_edit import Document
39+
from docx_editor import Document
4040

4141
with Document.open("contract.docx") as doc:
4242
doc.replace("old term", "new term")
@@ -221,7 +221,7 @@ doc.close() # cleanup=True is the default
221221
## Complete Example
222222

223223
```python
224-
from docx_edit import Document
224+
from docx_editor import Document
225225

226226
# Open document with custom author
227227
with Document.open("contract.docx", author="Legal Review") as doc:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
"""docx_edit - Pure Python Track Changes Library for Word Documents.
1+
"""docx_editor - Pure Python Track Changes Library for Word Documents.
22
33
A standalone library for Word document track changes and comments,
44
without requiring Microsoft Word installed.
55
66
Example:
7-
from docx_edit import Document
7+
from docx_editor import Document
88
99
# Open and edit
1010
doc = Document.open("contract.docx")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Comment management for docx_edit.
1+
"""Comment management for docx_editor.
22
33
Provides CommentManager for creating and managing document comments.
44
"""
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Main Document class for docx_edit.
1+
"""Main Document class for docx_editor.
22
33
Provides the primary user-facing API for editing Word documents with track changes
44
and comments.
@@ -18,14 +18,14 @@
1818
class Document:
1919
"""Word document with track changes and comment support.
2020
21-
This is the main entry point for docx_edit. It provides methods for:
21+
This is the main entry point for docx_editor. It provides methods for:
2222
- Opening and saving documents
2323
- Making tracked changes (replace, delete, insert)
2424
- Managing comments (add, reply, resolve, delete)
2525
- Managing revisions (list, accept, reject)
2626
2727
Example:
28-
from docx_edit import Document
28+
from docx_editor import Document
2929
3030
doc = Document.open("contract.docx")
3131
doc.replace("30 days", "60 days")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
"""Custom exceptions for docx_edit library."""
1+
"""Custom exceptions for docx_editor library."""
22

33

44
class DocxEditError(Exception):
5-
"""Base exception for all docx_edit errors."""
5+
"""Base exception for all docx_editor errors."""
66

77
pass
88

0 commit comments

Comments
 (0)