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
PYNE Documentation
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:
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.
pip install "hoox-pyne[lsp]"
pyne --version
# aliases: pynescript / pynescript-lsp
| Package | Latest | Registry |
|---|---|---|
| hoox-pyne | 0.6.4 | PyPI |
| @hoox-sh/pynets | 0.2.0 | npm |
| hoox-sh.pyne | 0.4.4 | VS Code / Open VSX |
| ghcr.io/hoox-sh/pyne/{api,cli,lsp} | 0.6.4 | GHCR |
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 and implementation status. 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.
What's new
hoox-pyne 0.6.4 (2026-09-14) — convert any older Pine version to v6 from the editor, LSP code action, pyne convert --to 6, and POST /lsp/convert.
0.6.3 — optional Flask/VPS/container hosted runner (PYNE_RUNNER) plus CLI pyne runner (deploy / tick / list). Scripts keep evaluating after upload without AXIS holding the connection.
0.6.2 — interpret wraps subscripted UDF parameters (s[1]) per call site so src = close; updown(src) matches compile. Official TradingView® builtin scripts are 0 MISMATCH vs compile.
0.6.1 — persistent InterpretSession (Runtime.create_session, delta append_bars, forming-bar update_last_bar). Dual-host strategy.cash qty-type, fill-time risk gates, session confirm-on-append, finalized-bucket HTF lookahead_on.
0.6.0 — type-aware intraday risk on both brokers, intrabar var rollback on realtime ticks, exchange-calendar timeframe.change D/W/M, request.security gaps_on / lookahead_on on HTF resample paths.
Full notes: GitHub releases · compatibility · evaluate scripts.
How to use
| Surface | Role | Start here |
|---|---|---|
| Library + CLI | Parse, lint, unparse, evaluate. Library Runtime.run defaults to interpret; pyne run is compile-only smoke | End User hub · modes |
| Language core | Grammar, AST, visitors, type system | Core |
| Runtime | Series caps, builtins, strategy, alerts, compiler parity | Runtime |
| LSP | Diagnostics, completion, hover, format (.pyne / .pine) | LSP |
| Pro API | HTTP /run (alerts + L2 webhooks), /optimize, preview, backtest | API |
| Ops | CI, Docker, Nuitka, secrets, GCP | DevOps |
| PyneTS | TypeScript / Bun library (parse / unparse / Runtime.run) | PyneTS |
| AXIS (separate product) | Charting PWA AXIS | AXIS docs |
| HOOX | Edge trade mesh | HOOX docs |
Conceptual model
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.
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, Cloud Build.
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):
| Kind | Path |
|---|---|
| Full-corpus LLM pack | llm.txt |
| LLM site map (llmstxt.org) | llms.txt |
| Track PDFs (A4) | /exports/pyne-*-manual.pdf |