diff --git a/.gitignore b/.gitignore index b193d91..4e2f91f 100644 --- a/.gitignore +++ b/.gitignore @@ -146,3 +146,25 @@ vite.config.ts.timestamp-* # Added by cargo /target + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg diff --git a/tests/expected_harappan_output.txt b/tests/expected_harappan_output.txt new file mode 100644 index 0000000..2042a4d --- /dev/null +++ b/tests/expected_harappan_output.txt @@ -0,0 +1 @@ +"Expected decoded output from the Harappan script input" diff --git a/tests/test_harappan_input.txt b/tests/test_harappan_input.txt new file mode 100644 index 0000000..1455eec --- /dev/null +++ b/tests/test_harappan_input.txt @@ -0,0 +1 @@ +"Example Harappan script input string" diff --git a/undec_script_decoder/__init__.py b/undec_script_decoder/__init__.py new file mode 100644 index 0000000..6ee17a0 --- /dev/null +++ b/undec_script_decoder/__init__.py @@ -0,0 +1,6 @@ +""" +undec_script_decoder - A decoder for undeciphered scripts (Harappan/Indus) +""" +from .undec import decode + +__all__ = ['decode'] diff --git a/undec_script_decoder/decode_text.py b/undec_script_decoder/decode_text.py new file mode 100644 index 0000000..4d63d36 --- /dev/null +++ b/undec_script_decoder/decode_text.py @@ -0,0 +1,16 @@ +from .undec import decode + +def undec_decode(input_str): + """ + A simple wrapper for the undec.decode() function. + """ + return decode(input_str) + +if __name__ == '__main__': + import sys + if len(sys.argv) > 1: + input_text = sys.argv[1] + decoded_text = undec_decode(input_text) + print(decoded_text) + else: + print("Usage: python -m undec_script_decoder.decode_text \"\"") diff --git a/undec_script_decoder/undec.py b/undec_script_decoder/undec.py new file mode 100644 index 0000000..9fab3e1 --- /dev/null +++ b/undec_script_decoder/undec.py @@ -0,0 +1,30 @@ +""" +Core decode function for undeciphered scripts. +Wraps the blackbox_indus_decoder from the parent module. +""" +import json +import sys +import os + +# Add parent directory to path to import the blackbox decoder +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +try: + from undec_script_blackbox import blackbox_indus_decoder +except ImportError: + # Fallback if import fails + def blackbox_indus_decoder(quest_glyph="base-symbol"): + return json.dumps({"error": "Decoder not available", "input": quest_glyph}) + + +def decode(input_str): + """ + Decode undeciphered script input. + + Args: + input_str: The script text or glyph identifier to decode + + Returns: + The decoded output as a string (JSON format) + """ + return blackbox_indus_decoder(input_str)