PYNE Documentation

Open-source Pine Script™ evaluation — grammar, AST, interpret/compile runtime, alerts + webhooks, LSP, Pro API. pip install hoox-pyne · github.com/hoox-sh/pyne

This page

Manuals

Full PDFComplete

PYNE is the open evaluation stack for TradingView® Pine Script™: a formal ANTLR4 grammar, an ASDL algebraic AST, a deterministic bar-loop evaluator (interpret / compile / mode=auto), a Language Server Protocol surface, a Flask Pro API, and edge workers that share one evaluate contract — including alerts and optional L2 webhooks.

For natural-language authoring (PYNE Agent), see the sister project pyne-agent-worker — standalone Cloudflare® Workers AI™ agent with optional AXIS plugin; does not require pyne-worker.

Pine Script™ and TradingView® are trademarks of TradingView®, Inc. This project is independent and not affiliated with or endorsed by TradingView®, Inc. Cloudflare® is a trademark of Cloudflare®, Inc.

Abstract

Where closed hosts couple the language to a proprietary charting host, PYNE treats the language as an inspectable pipeline:

code
Source (.pyne / .pine)
  → ANTLR4 lexer/parser (resource grammar)
  → ASDL AST (builder)
  → bar-loop (interpret | compile | auto)
  → plots / fill / events / drawings / alerts
  → optional L2 webhooks (Pro API + edge)

Live on PyPI as hoox-pyne (import pynescript). Source: github.com/hoox-sh/pyne.

bash
pip install "hoox-pyne[lsp]"
pyne --version
# aliases: pynescript / pynescript-lsp
PackageLatestRegistry
hoox-pyne0.6.31PyPI
@hoox-sh/pynets0.5.0npm
hoox-sh.pyne0.5.5VS Code / Open VSX
ghcr.io/hoox-sh/pyne/{api,cli,lsp,mcp}0.6.31GHCR

The same pipeline powers the desk CLI, the LSP binary, the Pro API, browser Pyodide (via AXIS), and Cloudflare® workers. Round-trip fidelity (parse → unparse) and interpret↔compile plot parity are first-class invariants — see compatibility. Local open-corpus set01–04 (2026-08-09): parse 99.96%, Runtime interpret 100% excl. intentional demos (set01 249/249). The repository does not ship third-party script corpora.

TypeScript consumers import PyneTS (@hoox-sh/pynets) — same public names; Python remains the oracle.

Release notes: GitHub releases · compatibility.

How to use

SurfaceRoleStart here
Library + CLIParse, lint, unparse, evaluate. Library Runtime.run defaults to interpret; pyne execute is CLI Runtime.run; pyne run is compile-only smokeEnd User hub · modes
Language coreGrammar, AST, visitors, type systemCore
RuntimeSeries caps, builtins, strategy, alerts, compiler parityRuntime
LSPDiagnostics, completion, hover, format (.pyne / .pine)LSP
MCPStdio pyne-mcp plus in-process pyne mcp call / pyne execute — parse, lint, convert, compile, Runtime.run, builtinsMCP
Pro APIHTTP /run (alerts + L2 webhooks), /optimize, preview, backtestAPI
OpsCI, Docker, Nuitka, self-hostDevOps
PyneTSTypeScript / Bun library (parse / unparse / Runtime.run)PyneTS
AXIS (separate product)Charting PWA AXISAXIS docs
HOOXEdge trade meshHOOX docs

Conceptual model

Diagram

Rendering…

Invariant: evaluation never requires a proprietary chart host. AXIS is an optional chart; HOOX is an optional execution mesh.

Tracks

End User

Install the package (pip install hoox-pyne), run the CLI, embed the library API, wire an editor (.pyne / .pine), or call the Pro API as a consumer — including alerts export and webhooks.

→ End User hub

Core / Runtime / LSP / API

Contributor and systems manuals: how the front-end, semantics, editor protocol, and HTTP bridge are built. Runtime covers series caps, incremental TA, drawing GC, fill() export, request.security HTF resample + barmerge (foreign/complex → na), strategy optimize, and parity.

DevOps

CI matrices, Fernet metadata encryption, Nuitka LSP binaries, containers.

→ DevOps hub

Reference

Compatibility guarantees, missing surface, numerical validation, PyneTS, ecosystem map, roadmap.

Sister surfaces

  • PyneTS — TypeScript / Bun library. Standalone hoox-sh/pynets / @hoox-sh/pynets. See PyneTS.
  • pyne-worker (sister repo) — Python Cloudflare® Worker for production POST /run (alerts + cron + R2).
  • pyne-agent-worker (sister repo) — NL authoring host (POST /v1/chat); optional validate via pyne-worker.
  • AXIS — installable PWA; documented at hoox.sh/axis/docs.
  • Family map — Ecosystem · modes.

Offline & agent exports

Auto-generated like HOOX manuals (bun run docs:exports):

KindPath
Full-corpus LLM packllm.txt
LLM site map (llmstxt.org)llms.txt
Track PDFs (A4)/exports/pyne-*-manual.pdf

See also