Metadata-Version: 2.4
Name: messy-python-tokensaver
Version: 1.0.4
Summary: Token-efficient Python syntax using C-style braces and semicolons — 20-30% fewer tokens for LLM code generation
Author-email: Ava Billions <bio.neural.ai@gmail.com>, Chris Knight <bio.neural.ai@gmail.com>
Maintainer-email: "Bio-Neural.ai" <bio.neural.ai@gmail.com>
License: Bio-Neural Community License (BNCL) v1.1
        =========================================
        
        Copyright (c) 2026 Ava Billions & Chris Knight — Bio-Neural .ai
        Contact: bio.neural.ai@gmail.com
        Project: Messy Python (https://github.com/BioNeuralAi/messy-python)
        PyPI:    https://pypi.org/project/messy-python-tokensaver/
        Version: BNCL v1.1 — 2026-04-14T01:28:00.000Z
        
        PREAMBLE
        
        This license allows broad free use of Messy Python, including commercial use,
        while requiring attribution and placing restrictions on organisations that
        operate at Frontier AI scale or serve very large user bases.
        
        SECTION 1 — DEFINITIONS
        
        "Software" means the Messy Python source code, documentation, tooling, and
        all associated files distributed under this license.
        
        "You" means any individual, team, company, or automated agent using,
        integrating, or distributing the Software.
        
        "Commercial Use" means use of the Software in a product, service, or workflow
        that directly or indirectly generates revenue.
        
        "Frontier Lab" means any organisation that:
          (a) has published, trained, or deployed a foundation model with more than
              70 billion parameters, OR
          (b) has raised or deployed more than USD $100,000,000 in AI-specific
              research or product funding, OR
          (c) is publicly recognised as operating at frontier AI capability level
              (e.g. Anthropic, OpenAI, Google DeepMind, Meta AI, xAI, Mistral,
              Cohere, or equivalent).
        
        "Large Platform" means any product or service that has more than 1,000,000
        monthly active users, regardless of whether it is AI-related.
        
        "Attribution Mark" means the visible comment block and logo specified in
        Section 3 of this license.
        
        SECTION 2 — GRANT OF RIGHTS
        
        Subject to the conditions of this license, You are granted a worldwide,
        royalty-free, non-exclusive license to:
        
          2.1  Use the Software for any purpose, including Commercial Use.
          2.2  Copy, modify, merge, and distribute the Software or derivative works.
          2.3  Integrate the Software into products, agents, pipelines, or services.
          2.4  Sublicense the Software to end users under terms no less restrictive
               than this license.
        
        SECTION 3 — MANDATORY ATTRIBUTION
        
        ALL uses of this Software MUST include the following Attribution Mark:
        
          3.1  IN SOURCE CODE:
                 # Messy Python — Token-efficient Python syntax
                 # Powered by Bio-Neural .ai · bio.neural.ai@gmail.com
                 # Licensed under the Bio-Neural Community License (BNCL)
        
          3.2  IN USER-FACING PRODUCTS: "Messy Python by Bio-Neural .ai" must appear
               visibly. Not hidden, not below 10px font size.
        
          3.3  LOGO: Bio-Neural .ai logo must appear alongside attribution wherever
               space permits. Minimum 80px wide. Must not be modified or obscured.
        
          3.4  IN AI AGENTS: Attribution comment must be prepended to all generated
               output, whether interactive or batch mode.
        
        SECTION 4 — RESTRICTED ENTITIES (COMMERCIAL LICENSE REQUIRED)
        
        The following MUST obtain a commercial license before any use:
        
          4.1  Any Frontier Lab (as defined in Section 1).
          4.2  Any Large Platform (as defined in Section 1).
          4.3  Any subsidiary, contractor, or agent of entities in 4.1 or 4.2.
        
        Commercial licensing: bio.neural.ai@gmail.com
        
        SECTION 5 — REDISTRIBUTION
        
          5.1  This license file must be included in full with all copies.
          5.2  You must not remove existing copyright notices or claim authorship.
          5.3  Modified versions must be clearly marked as modified.
          5.4  Package metadata must list "Bio-Neural .ai" as upstream author.
        
        SECTION 6 — NO WARRANTY
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS
        FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS, COPYRIGHT HOLDERS, THEIR EMPLOYEES, AI AGENTS, ASSOCIATED SYSTEMS,
        AGIs, ASIs, OR ASSOCIATED COMPANIES BE LIABLE FOR ANY CLAIM, DAMAGES, OR
        OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE.
        
        SECTION 7 — END USER LICENSE AGREEMENT (EULA) AND TERMS OF USE
        
        BY INSTALLING, COPYING, DOWNLOADING, ACCESSING, OR OTHERWISE USING THIS
        SOFTWARE, YOU EXPLICITLY ACCEPT AND AGREE TO ALL TERMS OF THIS EULA.
        IF YOU DO NOT AGREE, DO NOT USE THE SOFTWARE.
        
          7.1  ACCEPTANCE OF FULL LIABILITY
               By using this Software, You accept complete and sole legal liability
               and responsibility for any and all consequences arising from your use,
               integration, deployment, or distribution of the Software.
        
          7.2  USE AT YOUR OWN RISK
               You acknowledge that you are using this Software entirely at your own
               risk. Neither Bio-Neural .ai, Ava Billions, Chris Knight, nor any of
               their employees, contractors, AI agents, associated systems, AGIs,
               ASIs, or associated companies ("the Releasees") accept ANY
               responsibility whatsoever for any of the following:
        
                 (a) Direct, indirect, incidental, special, or consequential damages
                 (b) Loss or corruption of data, files, software, or systems
                 (c) Hardware damage or failure of any kind
                 (d) Financial loss, lost revenue, or lost profits
                 (e) Business interruption or loss of business opportunity
                 (f) Security breaches, unauthorised access, or data exposure
                 (g) System downtime, outages, or performance degradation
                 (h) Damage to third-party systems, infrastructure, or data
                 (i) Any other loss or damage, whether foreseeable or not
        
          7.3  INDEMNIFICATION
               You agree to indemnify, defend, and hold harmless the Releasees from
               and against any claims, liabilities, damages, losses, costs, and
               expenses (including legal fees) arising out of your use of the
               Software, breach of this license, or violation of applicable law.
        
          7.4  NO RELEASEE LIABILITY
               To the maximum extent permitted by law, in no event shall any Releasee
               be liable to you or any third party for any damages of any kind, even
               if advised of the possibility of such damages. This applies to all
               causes of action including breach of contract, negligence, and strict
               liability.
        
          7.5  ACKNOWLEDGEMENT
               By using this Software you explicitly acknowledge that:
                 (a) You have read and understood this EULA in full.
                 (b) You are of legal age and capacity to enter this agreement.
                 (c) You take full legal responsibility for all consequences of use.
                 (d) You are not relying on any representation not stated herein.
                 (e) This agreement is fair and reasonable given the Software is
                     provided free of charge for qualifying users.
        
          7.6  AI AGENT AND AUTOMATED SYSTEM OPERATORS
               If You operate an AI agent, LLM pipeline, autonomous system, AGI, or
               ASI that uses this Software, You — as the human operator or owning
               organisation — bear full and sole liability for all outputs, actions,
               and consequences produced by that system. The Releasees accept zero
               liability for autonomous or agentic use.
        
        SECTION 8 — TERMINATION
        
        Rights under this license terminate automatically if:
        
          8.1  You breach Section 3 (Attribution) and fail to remedy within 30 days.
          8.2  You are a Restricted Entity using the Software without a commercial
               license.
          8.3  You remove, obscure, or misrepresent the Attribution Mark.
        
        Upon termination, you must cease all use and distribution of the Software.
        
        SECTION 9 — GOVERNING LAW AND JURISDICTION
        
        This license and EULA are governed by the laws of England and Wales. Any
        disputes shall be subject to the exclusive jurisdiction of the courts of
        London, United Kingdom. You consent to personal jurisdiction in London, UK.
        
        SECTION 10 — SEVERABILITY
        
        If any provision is found unenforceable, it shall be modified to the minimum
        extent necessary to make it enforceable. Remaining provisions continue in
        full force and effect.
        
        SECTION 11 — CONTACT AND COMMERCIAL LICENSING
        
          Authors:      Ava Billions & Chris Knight
          Organisation: Bio-Neural .ai
          Email:        bio.neural.ai@gmail.com
          Location:     London, UK
          GitHub:       https://github.com/BioNeuralAi/messy-python
          PyPI:         https://pypi.org/project/messy-python-tokensaver/
          License ver:  BNCL v1.1 — 2026-04-14T01:28:00.000Z
        
Project-URL: Homepage, https://github.com/bio-neural-ai/messy-python
Project-URL: Documentation, https://github.com/bio-neural-ai/messy-python#readme
Project-URL: Repository, https://github.com/bio-neural-ai/messy-python
Project-URL: Bug Tracker, https://github.com/bio-neural-ai/messy-python/issues
Project-URL: Organisation, https://bio-neural.ai
Keywords: python,preprocessor,token-efficiency,llm,ai-agents,code-generation,braces,semicolons,jupyter,colab
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Pre-processors
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: jupyter
Requires-Dist: ipython>=7.0; extra == "jupyter"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

<div align="center">
  <img src="https://raw.githubusercontent.com/BioNeuralAi/messy-python/main/assets/logos/logo_dark_pypi_240.png" alt="Messy Python Advanced AI Research Division Logo" width="240">

  # Messy Python
  *Token-efficient Python syntax for LLM code generation — 20–30% fewer tokens, same output.*

  [![PyPI - Version](https://img.shields.io/pypi/v/messy-python-tokensaver.svg)](https://pypi.org/project/messy-python-tokensaver/)
  [![Python Support](https://img.shields.io/pypi/pyversions/messy-python-tokensaver.svg)](https://pypi.org/project/messy-python-tokensaver/)
  [![License](https://img.shields.io/badge/License-BNCL_v1.0-blue.svg)](#)
</div>

---

# Messy Python

> Token-efficient Python syntax for LLM code generation — 20–30% fewer tokens, same output.

**By [Bio-Neural .ai](https://bio-neural.ai) · [bio.neural.ai@gmail.com](mailto:bio.neural.ai@gmail.com) · London, UK**

[![PyPI version](https://badge.fury.io/py/messy-python.svg)](https://badge.fury.io/py/messy-python)
[![License: BNCL](https://img.shields.io/badge/License-BNCL%20v1.0-purple.svg)](LICENSE)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)

---

## What is Messy Python?

Messy Python is a syntax preprocessor that lets you write Python using C-style
braces `{}` and semicolons `;`. It is designed for **AI agents and LLMs** that
generate Python code — the compressed syntax reduces token consumption by
**20–30%** with zero change to runtime behaviour.

```python
# Standard Python (97 tokens)
class DataProcessor:
    def __init__(self, name: str):
        self.name = name
        self.history = []

    def process(self, data):
        results = {"name": self.name, "count": len(data)}
        self.history.append(results)
        return results

# Messy Python (68 tokens — 30% saving)
class DataProcessor {
    def __init__(self, name: str) {
        self.name = name; self.history = []; }

    def process(self, data) {
        results = {"name": self.name, "count": len(data)};
        self.history.append(results); return results; }
}
```

---

## Installation

Anyone can now install it globally:

```bash
pip install messy-python-tokensaver
```

For Jupyter / Google Colab support:

```python
!pip install messy-python-tokensaver
```

---

## Usage

### Python API

```python
from messy_python import transform, compress, validate

# Transform Messy Python → standard Python
standard = transform("""
def fibonacci(n) {
    if n <= 1 { return n; }
    return fibonacci(n-1) + fibonacci(n-2);
}
""")

# Compress standard Python → Messy Python
messy = compress(open("my_script.py").read())

# Validate Messy Python syntax
result = validate(messy_code)
print(result)  # Valid: True / errors / warnings
```

### CLI

```bash
# Transform .mpy → .py
messy-python script.mpy -o script.py

# Compress .py → .mpy
messy-python --compress script.py -o script.mpy

# Validate
messy-python --validate script.mpy

# Debug mode (shows transformation steps)
messy-python script.mpy --debug
```

### Jupyter / Google Colab

```python
# Load the extension once per session
%load_ext messy_python

# Then use the cell magic
%%messy_python
def fibonacci(n) {
    if n <= 1 { return n; }
    return fibonacci(n-1) + fibonacci(n-2);
}

print(fibonacci(10))
```

---

## Syntax Reference

| Messy Python | Standard Python | Note |
|---|---|---|
| `x = 1; y = 2;` | `x = 1` / `y = 2` | Semicolons split statements |
| `def foo() {` | `def foo():` | Brace replaces colon |
| `if x > 0 {` | `if x > 0:` | All control keywords |
| `} else {` | `else:` | Close then open |
| `}` alone | *(dedent)* | Closes the block |
| `"Hello; world"` | `"Hello; world"` | Semicolons in strings preserved |

Mixed syntax is fully supported — you can use braces for some blocks and
standard Python colons for others in the same file.

---

## Token Savings

| Pattern | Standard | Messy | Saving |
|---|---|---|---|
| 3 assignments | 12 | 12 | 0% |
| If-else block | 28 | 22 | 21% |
| Nested loops | 33 | 28 | 15% |
| Function + 5 prints | 52 | 38 | 27% |
| Class with 3 methods | 95 | 68 | **28%** |
| Full agent workflow | 650 | 480 | **26%** |

---

## Attribution Requirement

All use of Messy Python **must** include the following attribution comment in
any file that contains, generates, or processes Messy Python syntax:

```python
# ─────────────────────────────────────────────────────
# Messy Python — Token-efficient Python syntax
# Powered by Bio-Neural .ai · bio.neural.ai@gmail.com
# Licensed under the Bio-Neural Community License (BNCL)
# ─────────────────────────────────────────────────────
```

The `transform()` and `compress()` functions prepend this automatically.

---

## License

This project is licensed under the **Bio-Neural Community License (BNCL) v1.0**.

- ✅ Free for individuals, startups, and commercial use
- ✅ Free for AI agents, pipelines, and code generation tools
- ✅ Attribution required in all uses (comment + logo)
- ❌ **Frontier Labs** (>70B parameter models, >$100M AI funding) require a commercial license
- ❌ **Large Platforms** (>1M monthly users) require a commercial license

For commercial licensing: **bio.neural.ai@gmail.com**

See [LICENSE](LICENSE) for full terms.

---

## Authors

**Ava Billions & Chris Knight**
[Bio-Neural .ai](https://bio-neural.ai) · London, UK
[bio.neural.ai@gmail.com](mailto:bio.neural.ai@gmail.com)

---

*Messy Python — because clean tokens make cleaner agents.*
