From 9b424441f027f6b22756f2cbdd15677815210565 Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Fri, 5 Jul 2024 04:04:08 +0300 Subject: [PATCH] Remove `orjson` from dependencies --- duckduckgo_search/utils.py | 7 +++---- pyproject.toml | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/duckduckgo_search/utils.py b/duckduckgo_search/utils.py index daa957a..2ad107e 100644 --- a/duckduckgo_search/utils.py +++ b/duckduckgo_search/utils.py @@ -1,3 +1,4 @@ +import json import re from decimal import Decimal from html import unescape @@ -5,8 +6,6 @@ from typing import Any, Dict, List, Union from urllib.parse import unquote -import orjson - from .exceptions import DuckDuckGoSearchException REGEX_STRIP_TAGS = re.compile("<.*?>") @@ -14,14 +13,14 @@ def json_dumps(obj: Any) -> str: try: - return orjson.dumps(obj).decode("utf-8") + return json.dumps(obj) except Exception as ex: raise DuckDuckGoSearchException(f"{type(ex).__name__}: {ex}") from ex def json_loads(obj: Union[str, bytes]) -> Any: try: - return orjson.loads(obj) + return json.loads(obj) except Exception as ex: raise DuckDuckGoSearchException(f"{type(ex).__name__}: {ex}") from ex diff --git a/pyproject.toml b/pyproject.toml index b065a5d..aafcc6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,6 @@ classifiers = [ dependencies = [ "click>=8.1.7", "pyreqwest_impersonate>=0.4.9", - "orjson>=3.10.6", ] dynamic = ["version"]