API Reference

OceanScript is an Esoteric language used to encode and decode text into a formulation of characters - where the final result looks like waves in the ocean.

exception oceanscript.OceanScriptError(*, message, position=None)

Bases: Exception

Exception class used to raise decoding errors.

without_position_reference()

Returns the traceback string without the position reference at the end.

Returns

The traceback message without position reference.

Return type

str

oceanscript.decode(text)

Decode oceanscript into text.

Parameters

text (str) – The oceanscript to decode into text.

Returns

The original text.

Return type

str

oceanscript.encode(text, *, mode='squash')

Encode text into oceanscript.

Parameters
  • text (str) – The text to encode into oceanscript.

  • mode (Optional[Literal["squash", "stretch"]] = "squash") –

    The mode used to encode the oceanscript.

    Use ‘squash’ to replace spaces with commas. Use ‘stretch’ to replace spaces with line breaks.

Returns

The oceanscript.

Return type

str