Skip to content

Conversation

Copy link

Copilot AI commented Oct 15, 2025

This PR adds a Python package structure and API for the undeciphered script decoder, along with test fixtures for Harappan script input/output.

Changes

New Python Package: undec_script_decoder

Created a proper Python package structure with three key files:

  1. __init__.py - Package initialization that exports the decode function
  2. undec.py - Core decode function that wraps the existing blackbox_indus_decoder
  3. decode_text.py - Command-line interface wrapper with usage instructions

The module can be invoked from the command line:

python -m undec_script_decoder.decode_text "unicorn-seal"

This will decode the input using the existing Indus script decoder logic and output JSON with decoded patterns, possible meanings, confidence scores, and AI remix lore.

Test Files

Added a tests/ directory with two test fixture files:

  • test_harappan_input.txt - Example Harappan script input string
  • expected_harappan_output.txt - Expected decoded output from the Harappan script input

These files provide test cases for future integration testing of the decoder functionality.

Infrastructure

Updated .gitignore to exclude Python cache files (__pycache__/, *.pyc, etc.) to keep the repository clean.

Usage Example

# Decode a glyph
python -m undec_script_decoder.decode_text "fish-sign"

# Show usage
python -m undec_script_decoder.decode_text

Technical Details

The implementation properly integrates with the existing undec_script_blackbox.py decoder by:

  • Adding the parent directory to the Python path
  • Importing and wrapping blackbox_indus_decoder
  • Providing a clean API that can be extended for future enhancements

This lays the groundwork for building more comprehensive testing and API features around the Harappan/Indus script decoder functionality.

Original prompt

Create a new branch feature/api-and-tests from main.

  1. Add a new file named decode_text.py inside the undec_script_decoder directory with the following content:
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 \"<your_script_text>\"")
  1. Create a new directory named tests.

  2. Inside the tests directory, add a file named test_harappan_input.txt with the content:

"Example Harappan script input string"
  1. Inside the tests directory, add another file named expected_harappan_output.txt with the content:
"Expected decoded output from the Harappan script input"

The pull request should have a description explaining the changes.

This pull request was created as a result of the following prompt from Copilot chat.

Create a new branch feature/api-and-tests from main.

  1. Add a new file named decode_text.py inside the undec_script_decoder directory with the following content:
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 \"<your_script_text>\"")
  1. Create a new directory named tests.

  2. Inside the tests directory, add a file named test_harappan_input.txt with the content:

"Example Harappan script input string"
  1. Inside the tests directory, add another file named expected_harappan_output.txt with the content:
"Expected decoded output from the Harappan script input"

The pull request should have a description explaining the changes.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add decode_text script and test files Add Python API with decode_text.py module and test files for Harappan script decoder Oct 15, 2025
Copilot AI requested a review from EmergentMonk October 15, 2025 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants