diff --git a/json_unescape/__init__.py b/json_unescape/__init__.py index e69de29..6791265 100644 --- a/json_unescape/__init__.py +++ b/json_unescape/__init__.py @@ -0,0 +1,10 @@ +import json + + +def escape_json(json_str: str) -> str: + nested_object: dict = {"key": json_str} + return json.dumps(nested_object) + +def unescape_json(json_str: str) -> str: + nested_json_string: str = '{"key": ' + json_str + '}' + return json.loads(nested_json_string)["key"] diff --git a/json_unescape/__main__.py b/json_unescape/__main__.py deleted file mode 100644 index 453d429..0000000 --- a/json_unescape/__main__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .__about__ import __name__, __version__ - - -def cli(): - print(f"Running {__name__} version {__version__} from __main__.py") diff --git a/pyproject.toml b/pyproject.toml index 5ad050a..92700c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,9 +12,6 @@ classifiers = [ "Operating System :: OS Independent", ] -[project.scripts] -json-unescape = "json_unescape.__main__:cli" - [build-system] requires = ["hatchling", "hatch-requirements-txt"] build-backend = "hatchling.build"