diff --git a/Pipfile b/Pipfile index e52e244..f7a0320 100644 --- a/Pipfile +++ b/Pipfile @@ -10,7 +10,6 @@ unicodecsv = ">=0.14.1" "pdfminer.six" = "==20200104" Pillow = ">=7.0.0" Wand = "*" -six = "*" [dev-packages] tox = "*" diff --git a/pdfplumber/page.py b/pdfplumber/page.py index 7b5f8d2..2bee830 100644 --- a/pdfplumber/page.py +++ b/pdfplumber/page.py @@ -4,7 +4,6 @@ from .table import TableFinder from .container import Container from copy import copy -from six import string_types import re lt_pat = re.compile(r"^LT") diff --git a/pdfplumber/utils.py b/pdfplumber/utils.py index 26d689a..7e04f51 100644 --- a/pdfplumber/utils.py +++ b/pdfplumber/utils.py @@ -1,23 +1,11 @@ from pdfminer.utils import PDFDocEncoding from pdfminer.psparser import PSLiteral from pdfminer.pdftypes import PDFObjRef -try: - from cdecimal import Decimal, ROUND_HALF_UP -except ImportError: - from decimal import Decimal, ROUND_HALF_UP +from decimal import Decimal, ROUND_HALF_UP import numbers from operator import itemgetter import itertools -import six - -if six.PY3: - from functools import lru_cache as cache -else: - # Python 2 has no lru_cache, so defining as a no-op - def cache(**kwargs): - def decorator(fn): - return fn - return decorator +from functools import lru_cache as cache DEFAULT_X_TOLERANCE = 3 DEFAULT_Y_TOLERANCE = 3 @@ -77,7 +65,7 @@ def decode_text(s): Adds py3 compatibility to pdfminer's version. """ if type(s) == bytes and s.startswith(b'\xfe\xff'): - return six.text_type(s[2:], 'utf-16be', 'ignore') + return str(s[2:], 'utf-16be', 'ignore') else: ords = (ord(c) if type(c) == str else c for c in s) return ''.join(PDFDocEncoding[o] for o in ords) diff --git a/setup.py b/setup.py index 34bdac6..766163f 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,6 @@ base_reqs = [ "pycryptodome", "unicodecsv>=0.14.1", "pdfminer.six==20200104", - "six", "pillow>=7.0.0", "wand" ]