PyneCore - Pine Script to Python Transpiler
Installation (New Computer)
# 1. Navigate to the pynecore directory
cd pynecore
# 2. Create virtual environment
python3 -m venv .venv
# 3. Install pynecore runtime (editable mode)
.venv/bin/pip install -e ~/workspace/github/pynecore
# 4. Install required dependencies
.venv/bin/pip install typer typing_extensions
# 5. Activate the virtual environment
source .venv/bin/activate # On Linux/mac
# OR
.venv\Scripts\activate # On Windows
Note: All commands below assume you are in the pynecore directory with the venv activated.
How to Convert Pine Script to Python
Single File Conversion
python -m pine2pyne path/to/script.pine -o path/to/output.py
Batch Conversion
python -m pine2pyne "sample/pinescript/*.pine" -o workdir/scripts/
Running Tests
Run All Test Samples
python test_all_samples.py
Run Specific Pattern
python test_all_samples.py "ex_001*" # Filter by pattern
python test_all_samples.py "ex_347_*" # Single file pattern
Additional Options
python test_all_samples.py --timeout 30 # Custom timeout (default: 15s)
python test_all_samples.py --verbose # Show stderr on failure
Test Framework Details
- Source directory:
sample/pinescript/ - Output directory:
workdir/scripts/ - Test data:
workdir/data/ - Results:
test_results.jsonandtest_results.txt
For Claude Code / LLM Development
See CLAUDE.md in this directory for transpiler architecture, output format specs, optimizer documentation, and CSV rounding rules. See pine2pyne/README.md for transpiler internals and transformation rules.
Optimizing Strategies
Quick start: pyne optimize script.py data.ohlcv params.json -n 20
See Optimizer.md for full documentation (parameter JSON format, parallel execution, output files).
Distributed Optimization (multi-machine)
Two tools distribute pyne optimize across SSH clusters:
| Tool | Model | Best for |
|---|---|---|
pyne-dynamic.sh |
Flat-queue (on-demand dispatch) | Multi-variant runs, heterogeneous clusters, long jobs |
pyne-parallel.sh |
Static pre-assignment | Quick jobs on similar-speed machines |
# Dynamic (recommended): flat-queue, pre-syncs once, auto-adapts to machine speed
# Run from workdir/ directory:
../tools/pyne-dynamic.sh scripts/strategy.py data/data.ohlcv optimize_variants/ \
-H ../tools/machines.txt -C 24 --name my_run --output-dir runs/output/
# Static: pre-assigns chunks by core count
./tools/pyne-parallel.sh scripts/strategy.py data/data.ohlcv optimize.json \
-H tools/machines.txt --sync
# Check progress / collect results
../tools/pyne-dynamic.sh --status
../tools/pyne-dynamic.sh --collect
Both use the same machines.txt format. See CLAUDE.md for cluster setup, machine file format, and troubleshooting.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opencode_pine2pyne-0.1.0.tar.gz.
File metadata
- Download URL: opencode_pine2pyne-0.1.0.tar.gz
- Upload date:
- Size: 87.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
508f34336d12d6a55e5d73c7763bb28e7788b79ebaa290ffcd204e176dd9003f
|
|
| MD5 |
c2781ff3607651b042513a6092e0874a
|
|
| BLAKE2b-256 |
8eaf105349a9f014fd452f9fa58a6de43e84b46957aa69b7dec1ae16893f3731
|
File details
Details for the file opencode_pine2pyne-0.1.0-py3-none-any.whl.
File metadata
- Download URL: opencode_pine2pyne-0.1.0-py3-none-any.whl
- Upload date:
- Size: 88.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06782d6a4e7a7f60ce7cb6ecb7143c8744f3ce59e0cfadbbe1ef6a0cb6c68857
|
|
| MD5 |
001a98ccb9f8fa1443f0a0cae2dace5e
|
|
| BLAKE2b-256 |
c2b6d7fa946d4f3d97bc50bfc2e33ae0845eac65a8a42b07ca46d5d594446104
|