Skip to content

Commit

Permalink
Remove utils.collate_chars(...)
Browse files Browse the repository at this point in the history
This was the previous name (and then alias) for utils.extract_text(...),
and hasn't been featured in the documentation in a long time.
  • Loading branch information
jsvine committed May 13, 2022
1 parent 58b1ab1 commit 24f3532
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ All notable changes to this project will be documented in this file. The format
- Add `pdfplumber.ctm` submodule with class `CTM`, to calculate scale, skew, and translation of the current transformation matrix.
- Add `page.search(...)`, an *experimental feature* that allows you to search a page's text via regular expressions and non-regex strings, returning the text, any regex matches, the bounding box coordinates, and the char objects themselves. ([#201](https://github.com/jsvine/pdfplumber/issues/201))

### Removed

- Remove `utils.collate_chars(...)`, the old name (and then alias) for `utils.extract_text(...)`.

## [0.6.2] - 2022-05-06

### Added
Expand Down
3 changes: 0 additions & 3 deletions pdfplumber/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,6 @@ def extract_text(
return "\n".join(lines)


collate_chars = extract_text


def get_bbox_overlap(a: T_bbox, b: T_bbox) -> Optional[T_bbox]:
a_left, a_top, a_right, a_bottom = a
b_left, b_top, b_right, b_bottom = b
Expand Down
4 changes: 2 additions & 2 deletions tests/test_nics_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from operator import itemgetter

import pdfplumber
from pdfplumber.utils import collate_chars, within_bbox
from pdfplumber.utils import extract_text, within_bbox

logging.disable(logging.ERROR)

Expand Down Expand Up @@ -85,7 +85,7 @@ def parse_row(row):
assert colsum == (total * 2)

month_chars = within_bbox(page.chars, (0, 35, self.PDF_WIDTH, 65))
month_text = collate_chars(month_chars)
month_text = extract_text(month_chars)
assert month_text == "November - 2015"

def test_filter(self):
Expand Down

0 comments on commit 24f3532

Please sign in to comment.