deluge-compat


Namedeluge-compat JSON
Version 1.2.11 PyPI version JSON
download
home_pageNone
SummaryPython compatibility layer for executing Deluge scripts with full SalesIQ/Zobot support
upload_time2025-07-13 23:18:26
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2025 deluge-compat contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. DISCLAIMER: This license applies only to the compatibility layer implementation and does not grant any rights to the Deluge scripting language itself, which is a proprietary language owned by Zoho Corporation. "Deluge" is a trademark of Zoho Corporation. This project is not affiliated with, endorsed by, or sponsored by Zoho Corporation.
keywords compatibility deluge salesiq scripting zobot zoho
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Deluge Compatibility Layer

A Python compatibility layer that allows you to execute Deluge scripts within Python environments. This project provides a runtime environment and translator that converts Deluge language syntax to Python, enabling testing and execution of Deluge scripts outside of their native environment.

## Features

- **Complete Data Type Support**: Implements Deluge's Map, List, and String types with all their methods
- **Built-in Functions**: HTTP requests, encoding/decoding, mathematical operations, and utility functions
- **Script Translation**: Converts Deluge syntax to executable Python code
- **Runtime Environment**: Provides a sandboxed execution context for Deluge scripts
- **Zobot Support**: Full SalesIQ/Zobot development with interactive chat simulation
- **Easy Integration**: Simple API for running Deluge scripts from Python

## Installation

### Full Installation (Recommended)

Includes CLI tools, rich output formatting, and all features:

```bash
# Install from PyPI (when published)
pip install deluge-compat

# Or with uv
uv add deluge-compat

# Or from source
git clone git@github.com:jctosta/deluge-compat.git
cd deluge-compat
uv install
```

### Slim Installation

For minimal dependencies in environments where you only need the core compatibility layer:

```bash
pip install deluge-compat[slim]
# or
uv add deluge-compat[slim]
```

The slim version excludes CLI tools and rich formatting but retains all core translation and execution capabilities.

## Quick Start

### Command Line Tools

The package provides CLI tools for working with Deluge scripts:

#### Running Deluge Scripts

```bash
# Run a Deluge script file
deluge-run my_script.dg

# Run with JSON output
deluge-run my_script.dg --json

# Run with verbose output
deluge-run my_script.dg --verbose
```

#### Translating Deluge Scripts to Python

```bash
# Translate a Deluge script to Python
deluge-translate my_script.dg --output converted.py
```

#### Interactive Zobot Chat Testing

```bash
# Test Zobot scripts with interactive chat
deluge-chat my_zobot.dg

# Use specific visitor data
deluge-chat my_zobot.dg --visitor-mock-source json --visitor-mock-file visitor_data.json

# Automated testing with predefined messages
deluge-chat my_zobot.dg --message-mock-source json --message-mock-file test_messages.json
```

For detailed usage information, see our [documentation](#documentation).

### Basic Usage Examples

```python
from deluge_compat import run_deluge_script

# Simple script execution
result = run_deluge_script('''
    response = Map();
    response.put("greeting", "Hello World!");
    return response;
''')
print(result)  # {'greeting': 'Hello World!'}

# With context variables
result = run_deluge_script('''
    greeting = "Hello " + username + "!";
    return Map({"message": greeting});
''', username="Alice")
print(result['message'])  # "Hello Alice!"
```

### Translation to Python

```python
from deluge_compat import translate_deluge_to_python

# Generate PEP 723 compatible Python script
python_code = translate_deluge_to_python('''
    numbers = List([1, 2, 3]);
    sum = 0;
    for each num in numbers {
        sum = sum + num;
    }
    return Map({"sum": sum});
''')

# Save and run with: uv run script.py
with open("script.py", "w") as f:
    f.write(python_code)
```

## Documentation

### Core Features
- **[Basic Usage Guide](docs/BASIC_USAGE.md)** - Complete guide to data types, functions, and common patterns
- **[Zobot Support Guide](docs/ZOBOT_SUPPORT.md)** - SalesIQ/Zobot development with interactive testing

### Quick Reference

**Data Types**: Map, List, String with full Deluge method compatibility
**Functions**: HTTP, encoding, math, utilities, and SalesIQ session management
**CLI Tools**: `deluge-run`, `deluge-translate`, `deluge-chat`
**Testing**: Comprehensive test suite with 28 SalesIQ tests + 115 core tests

## Examples

Check the `examples/` directory and documentation for comprehensive examples:

- **Basic Operations**: Data manipulation, string processing, control flow
- **HTTP Integration**: API calls, data processing, error handling
- **Zobot Scripts**: Customer service bots, session management, interactive chat
- **Translation Examples**: Converting Deluge to Python with PEP 723 support

## Testing

Comprehensive test coverage with **143 total tests** (115 core + 28 SalesIQ) achieving **100% success rate**.

```bash
# Run all tests
uv run pytest

# Test specific functionality
uv run pytest tests/test_types.py      # Data types
uv run pytest tests/test_salesiq.py    # SalesIQ/Zobot features
uv run pytest tests/test_showcase.py   # Working features demo
```

✅ **Production Ready**: Complete Deluge language support with full SalesIQ/Zobot compatibility

## Project Structure

```
deluge-compat/
├── src/deluge_compat/
│   ├── __init__.py          # Main API
│   ├── types.py             # Deluge data types
│   ├── functions.py         # Built-in functions
│   ├── translator.py        # Deluge → Python translator
│   ├── runtime.py           # Execution environment
│   ├── cli_*.py             # CLI tools
│   └── salesiq/             # SalesIQ/Zobot support
├── docs/                    # Documentation
├── examples/                # Usage examples
└── tests/                   # Test suite
```

## Architecture

**Core Engine**: Types, Functions, Translator, Runtime
**SalesIQ Layer**: Visitor/Message objects, session management, mock system
**CLI Tools**: Interactive testing, script translation, chat simulation
**Testing**: Comprehensive validation with 143 tests

All core Deluge features are fully supported with complete SalesIQ/Zobot compatibility.

## Contributing

We welcome contributions! Please:

1. Fork the repository
2. Create a feature branch
3. Add comprehensive tests
4. Ensure all tests pass (`uv run pytest`)
5. Run code quality checks (`uv run ruff check .` and `uv run pyright .`)
6. Submit a pull request

See [development documentation](docs/) for detailed contribution guidelines.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Acknowledgments

- Based on the Deluge language specification and documentation
- Inspired by the [Deluge Language Parser](https://github.com/GuruDhanush/Deluge-Language-Parser) project
- Built with Python 3.12+ and modern tooling
- **Created with the assistance of Claude Code** - Anthropic's AI-powered coding assistant

---

## Disclaimer

**Deluge Language Ownership**: Deluge is a proprietary scripting language owned and developed by Zoho Corporation. This project is an independent, unofficial compatibility layer created for educational and development purposes. It is not affiliated with, endorsed by, or sponsored by Zoho Corporation.

**Usage Notice**: This compatibility layer is intended for testing, development, and educational purposes only. For production Deluge script execution, please use the official Deluge runtime environment provided by Zoho Corporation.

**Trademark Notice**: "Deluge" is a trademark of Zoho Corporation. This project respects all intellectual property rights and trademarks of Zoho Corporation.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "deluge-compat",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "compatibility, deluge, salesiq, scripting, zobot, zoho",
    "author": null,
    "author_email": "Carlos Tosta <jctosta86@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/54/a9/635b005b97b5a5c2a8543ad4c7543e1c600afde64c54893052f7a3e2da1b/deluge_compat-1.2.11.tar.gz",
    "platform": null,
    "description": "# Deluge Compatibility Layer\n\nA Python compatibility layer that allows you to execute Deluge scripts within Python environments. This project provides a runtime environment and translator that converts Deluge language syntax to Python, enabling testing and execution of Deluge scripts outside of their native environment.\n\n## Features\n\n- **Complete Data Type Support**: Implements Deluge's Map, List, and String types with all their methods\n- **Built-in Functions**: HTTP requests, encoding/decoding, mathematical operations, and utility functions\n- **Script Translation**: Converts Deluge syntax to executable Python code\n- **Runtime Environment**: Provides a sandboxed execution context for Deluge scripts\n- **Zobot Support**: Full SalesIQ/Zobot development with interactive chat simulation\n- **Easy Integration**: Simple API for running Deluge scripts from Python\n\n## Installation\n\n### Full Installation (Recommended)\n\nIncludes CLI tools, rich output formatting, and all features:\n\n```bash\n# Install from PyPI (when published)\npip install deluge-compat\n\n# Or with uv\nuv add deluge-compat\n\n# Or from source\ngit clone git@github.com:jctosta/deluge-compat.git\ncd deluge-compat\nuv install\n```\n\n### Slim Installation\n\nFor minimal dependencies in environments where you only need the core compatibility layer:\n\n```bash\npip install deluge-compat[slim]\n# or\nuv add deluge-compat[slim]\n```\n\nThe slim version excludes CLI tools and rich formatting but retains all core translation and execution capabilities.\n\n## Quick Start\n\n### Command Line Tools\n\nThe package provides CLI tools for working with Deluge scripts:\n\n#### Running Deluge Scripts\n\n```bash\n# Run a Deluge script file\ndeluge-run my_script.dg\n\n# Run with JSON output\ndeluge-run my_script.dg --json\n\n# Run with verbose output\ndeluge-run my_script.dg --verbose\n```\n\n#### Translating Deluge Scripts to Python\n\n```bash\n# Translate a Deluge script to Python\ndeluge-translate my_script.dg --output converted.py\n```\n\n#### Interactive Zobot Chat Testing\n\n```bash\n# Test Zobot scripts with interactive chat\ndeluge-chat my_zobot.dg\n\n# Use specific visitor data\ndeluge-chat my_zobot.dg --visitor-mock-source json --visitor-mock-file visitor_data.json\n\n# Automated testing with predefined messages\ndeluge-chat my_zobot.dg --message-mock-source json --message-mock-file test_messages.json\n```\n\nFor detailed usage information, see our [documentation](#documentation).\n\n### Basic Usage Examples\n\n```python\nfrom deluge_compat import run_deluge_script\n\n# Simple script execution\nresult = run_deluge_script('''\n    response = Map();\n    response.put(\"greeting\", \"Hello World!\");\n    return response;\n''')\nprint(result)  # {'greeting': 'Hello World!'}\n\n# With context variables\nresult = run_deluge_script('''\n    greeting = \"Hello \" + username + \"!\";\n    return Map({\"message\": greeting});\n''', username=\"Alice\")\nprint(result['message'])  # \"Hello Alice!\"\n```\n\n### Translation to Python\n\n```python\nfrom deluge_compat import translate_deluge_to_python\n\n# Generate PEP 723 compatible Python script\npython_code = translate_deluge_to_python('''\n    numbers = List([1, 2, 3]);\n    sum = 0;\n    for each num in numbers {\n        sum = sum + num;\n    }\n    return Map({\"sum\": sum});\n''')\n\n# Save and run with: uv run script.py\nwith open(\"script.py\", \"w\") as f:\n    f.write(python_code)\n```\n\n## Documentation\n\n### Core Features\n- **[Basic Usage Guide](docs/BASIC_USAGE.md)** - Complete guide to data types, functions, and common patterns\n- **[Zobot Support Guide](docs/ZOBOT_SUPPORT.md)** - SalesIQ/Zobot development with interactive testing\n\n### Quick Reference\n\n**Data Types**: Map, List, String with full Deluge method compatibility\n**Functions**: HTTP, encoding, math, utilities, and SalesIQ session management\n**CLI Tools**: `deluge-run`, `deluge-translate`, `deluge-chat`\n**Testing**: Comprehensive test suite with 28 SalesIQ tests + 115 core tests\n\n## Examples\n\nCheck the `examples/` directory and documentation for comprehensive examples:\n\n- **Basic Operations**: Data manipulation, string processing, control flow\n- **HTTP Integration**: API calls, data processing, error handling\n- **Zobot Scripts**: Customer service bots, session management, interactive chat\n- **Translation Examples**: Converting Deluge to Python with PEP 723 support\n\n## Testing\n\nComprehensive test coverage with **143 total tests** (115 core + 28 SalesIQ) achieving **100% success rate**.\n\n```bash\n# Run all tests\nuv run pytest\n\n# Test specific functionality\nuv run pytest tests/test_types.py      # Data types\nuv run pytest tests/test_salesiq.py    # SalesIQ/Zobot features\nuv run pytest tests/test_showcase.py   # Working features demo\n```\n\n\u2705 **Production Ready**: Complete Deluge language support with full SalesIQ/Zobot compatibility\n\n## Project Structure\n\n```\ndeluge-compat/\n\u251c\u2500\u2500 src/deluge_compat/\n\u2502   \u251c\u2500\u2500 __init__.py          # Main API\n\u2502   \u251c\u2500\u2500 types.py             # Deluge data types\n\u2502   \u251c\u2500\u2500 functions.py         # Built-in functions\n\u2502   \u251c\u2500\u2500 translator.py        # Deluge \u2192 Python translator\n\u2502   \u251c\u2500\u2500 runtime.py           # Execution environment\n\u2502   \u251c\u2500\u2500 cli_*.py             # CLI tools\n\u2502   \u2514\u2500\u2500 salesiq/             # SalesIQ/Zobot support\n\u251c\u2500\u2500 docs/                    # Documentation\n\u251c\u2500\u2500 examples/                # Usage examples\n\u2514\u2500\u2500 tests/                   # Test suite\n```\n\n## Architecture\n\n**Core Engine**: Types, Functions, Translator, Runtime\n**SalesIQ Layer**: Visitor/Message objects, session management, mock system\n**CLI Tools**: Interactive testing, script translation, chat simulation\n**Testing**: Comprehensive validation with 143 tests\n\nAll core Deluge features are fully supported with complete SalesIQ/Zobot compatibility.\n\n## Contributing\n\nWe welcome contributions! Please:\n\n1. Fork the repository\n2. Create a feature branch\n3. Add comprehensive tests\n4. Ensure all tests pass (`uv run pytest`)\n5. Run code quality checks (`uv run ruff check .` and `uv run pyright .`)\n6. Submit a pull request\n\nSee [development documentation](docs/) for detailed contribution guidelines.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- Based on the Deluge language specification and documentation\n- Inspired by the [Deluge Language Parser](https://github.com/GuruDhanush/Deluge-Language-Parser) project\n- Built with Python 3.12+ and modern tooling\n- **Created with the assistance of Claude Code** - Anthropic's AI-powered coding assistant\n\n---\n\n## Disclaimer\n\n**Deluge Language Ownership**: Deluge is a proprietary scripting language owned and developed by Zoho Corporation. This project is an independent, unofficial compatibility layer created for educational and development purposes. It is not affiliated with, endorsed by, or sponsored by Zoho Corporation.\n\n**Usage Notice**: This compatibility layer is intended for testing, development, and educational purposes only. For production Deluge script execution, please use the official Deluge runtime environment provided by Zoho Corporation.\n\n**Trademark Notice**: \"Deluge\" is a trademark of Zoho Corporation. This project respects all intellectual property rights and trademarks of Zoho Corporation.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2025 deluge-compat contributors  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  DISCLAIMER: This license applies only to the compatibility layer implementation and does not grant any rights to the Deluge scripting language itself, which is a proprietary language owned by Zoho Corporation. \"Deluge\" is a trademark of Zoho Corporation. This project is not affiliated with, endorsed by, or sponsored by Zoho Corporation.",
    "summary": "Python compatibility layer for executing Deluge scripts with full SalesIQ/Zobot support",
    "version": "1.2.11",
    "project_urls": {
        "Documentation": "https://github.com/jctosta/deluge-compat/tree/main/docs",
        "Homepage": "https://github.com/jctosta/deluge-compat",
        "Issues": "https://github.com/jctosta/deluge-compat/issues",
        "Repository": "https://github.com/jctosta/deluge-compat"
    },
    "split_keywords": [
        "compatibility",
        " deluge",
        " salesiq",
        " scripting",
        " zobot",
        " zoho"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d85bf1c38b1180c5920ad782e9529c078fe43edd21a67725a1dd7cd04995570f",
                "md5": "64243c857fbb20a0e9de933dd4f57734",
                "sha256": "9b03ab5d8ac881f61ffc49f8016d4b5400f8b8a503440525190cc9fefcd028d4"
            },
            "downloads": -1,
            "filename": "deluge_compat-1.2.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "64243c857fbb20a0e9de933dd4f57734",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 30935,
            "upload_time": "2025-07-13T23:18:24",
            "upload_time_iso_8601": "2025-07-13T23:18:24.881659Z",
            "url": "https://files.pythonhosted.org/packages/d8/5b/f1c38b1180c5920ad782e9529c078fe43edd21a67725a1dd7cd04995570f/deluge_compat-1.2.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "54a9635b005b97b5a5c2a8543ad4c7543e1c600afde64c54893052f7a3e2da1b",
                "md5": "8523c553487b60736f127c9f07e56650",
                "sha256": "9c4b97c087fee296849d90a4e955e3141ee637ab47509b0c68979c3124f4920e"
            },
            "downloads": -1,
            "filename": "deluge_compat-1.2.11.tar.gz",
            "has_sig": false,
            "md5_digest": "8523c553487b60736f127c9f07e56650",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 59900,
            "upload_time": "2025-07-13T23:18:26",
            "upload_time_iso_8601": "2025-07-13T23:18:26.147632Z",
            "url": "https://files.pythonhosted.org/packages/54/a9/635b005b97b5a5c2a8543ad4c7543e1c600afde64c54893052f7a3e2da1b/deluge_compat-1.2.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-13 23:18:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jctosta",
    "github_project": "deluge-compat",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "deluge-compat"
}
        
Elapsed time: 1.21244s